Skip to content

[18.0][FIX] web_responsive: prevent duplicate navigation on app menu click - #3654

Merged
OCA-git-bot merged 1 commit into
OCA:18.0from
Pepo48:issue-3653
Sep 4, 2026
Merged

OCA-git-bot merged 1 commit into
OCA:18.0from
Pepo48:issue-3653

Conversation

@Pepo48

@Pepo48 Pepo48 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Closes: #3653

@pedrobaeza

Copy link
Copy Markdown
Member

This was done on purpose, as we don't want to block the navigation to the apps menu if there are missing required fields or to auto-save. Only when navigating to another menu, this will be performed.

@Pepo48

Pepo48 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@pedrobaeza thanks for the prompt reaction!

As for the clearUncommittedChanges check, I acknowledged it the issue description that it is a UX preference. I'm fine with dropping that part, although I would still argue that it makes the behaviour unintuitive.

But the ev.preventDefault() in AppMenuItem.onClick is a separate issue. Without it, clicking an app tile triggers navigation twice, once from the click handler, once from the browser following the link. Normally that's harmless, but when the current form has unsaved changes that can't be saved, the two paths conflict and the app freezes. Only a full page refresh recovers it.

The fix is just preventing the browser from following the link, which is standard for links handled by JavaScript. It's the same pattern Odoo uses for its own menu items.

@pedrobaeza pedrobaeza added this to the 18.0 milestone Sep 2, 2026
@pedrobaeza

Copy link
Copy Markdown
Member

OK, please keep only this second commit, rephrase the commit message accordingly, and remove [18.0] from it.

@Pepo48 Pepo48 changed the title [18.0] web_responsive: check unsaved changes before app navigation [18.0] web_responsive: prevent duplicate navigation on app menu click Sep 2, 2026

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedrobaeza pedrobaeza changed the title [18.0] web_responsive: prevent duplicate navigation on app menu click [18.0][FIX] web_responsive: prevent duplicate navigation on app menu click Sep 2, 2026
@Pepo48

Pepo48 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@pedrobaeza done.

Closes: OCA#3653

Signed-off-by: Peter Zaoral <pepo48@gmail.com>

@tarteo tarteo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed, I was able to reproduce the bug and this fixes the issue 👍

@pedrobaeza

Copy link
Copy Markdown
Member

/ocabot merge patch

Please fw-port it to 19 if needed

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 18.0-ocabot-merge-pr-3654-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 1ad9d61 into OCA:18.0 Sep 4, 2026
9 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at c918d67. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[18.0] web_responsive: AppMenuItem bypasses unsaved changes check

4 participants