Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: re-open context-menu on closing contextmenu event #7484

Merged
merged 7 commits into from
Jun 20, 2024

Conversation

tomivirkki
Copy link
Member

Description

Dispatch a new contextmenu event over the target in case the context-menu gets closed by a contextmenu event. This enables opening a new context menu without closing the previous one first.

Kapture.2024-06-11.at.13.38.34.mp4

Fixes #1135

Type of change

Bugfix

@tomivirkki tomivirkki force-pushed the fix/context-menu/re-open-on-contextmenu branch 2 times, most recently from 2ec2a8a to 12dd118 Compare June 11, 2024 11:57
@tomivirkki tomivirkki marked this pull request as draft June 11, 2024 12:07
@tomivirkki tomivirkki force-pushed the fix/context-menu/re-open-on-contextmenu branch 3 times, most recently from 64cbd24 to 6e8bd8a Compare June 17, 2024 14:11
@tomivirkki tomivirkki force-pushed the fix/context-menu/re-open-on-contextmenu branch from 6e8bd8a to a210da9 Compare June 17, 2024 14:23
@tomivirkki tomivirkki marked this pull request as ready for review June 18, 2024 06:45
Copy link
Contributor

@DiegoCardoso DiegoCardoso left a comment

Choose a reason for hiding this comment

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

LGTM

The only question I have is whether this can be considered a breaking behavioral change since it required two right clicks before opening a new context menu.

@tomivirkki
Copy link
Member Author

The only question I have is whether this can be considered a breaking behavioral change since it required two right clicks before opening a new context menu.

That's a valid point. The new behavior is aligned with how native context menus work in general (in Finder etc) so it might also be expected by users. To be on the safe side, we could at least skip cherry-picking this to earlier minors (and only target 24.5). @rolfsmeds @yuriy-fix wdyt?

Copy link

sonarcloud bot commented Jun 20, 2024

@tomivirkki tomivirkki merged commit abed0bf into main Jun 20, 2024
9 checks passed
@tomivirkki tomivirkki deleted the fix/context-menu/re-open-on-contextmenu branch June 20, 2024 08:42
@tomivirkki
Copy link
Member Author

We discussed this internally and agreed to merge this to 24.5 as a minor behavioral breaking change:

  • Before: A right click outside an open context menu would close the context menu. A second right click would open a new one.
  • After: A right click outside an open context menu would close the context menu and open another one to the coordinates of the click.

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha4 and is also targeting the upcoming stable 24.5.0 version.

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.

[context-menu] When context-menu is opened second right-click should re-open it
3 participants