Repository navigation
feat: add lookup of context menus attached to a component - #10269
Merged
Merged
Conversation
Reviewed-by: Martin Vysny <mavi@vaadin.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
vaadin-review-bot
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the changes — left 1 comment.
| Finding | |
|---|---|
| 🧪 | No test covers clearing one menu's target when the target has several menus. |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Member
|
@mvysny Should the mentioned issues be tagged as closed, or is there anything else in them that has not been solved? From a quick glance I'd say this PR resolves them. |
Member
Author
|
@sissbruecker agree, this PR solves both #1520 and #1514 fully. |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
sissbruecker
approved these changes
Sep 29, 2026
Collaborator
|
This ticket/PR has been released with Vaadin 25.4.0-alpha1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Fixes #1520
Fixes #1514
ContextMenu.getContextMenus(Component)andGridContextMenu.getContextMenus(Grid)returning the menus of that type that target a component, in the order their target was setsetTarget()keeps the list up to date when a target is set, replaced or clearedGrid.getContextMenus()returning theGridContextMenuinstances that target the gridThe main use case is browserless testing (Karibu-Testing), where a test needs to find a menu that application code created. The target already holds a reference to the menu through its before-open listener, so storing the menu in the target's
ComponentUtildata does not keep anything in memory longer than before.Type of change
Note
Reviewed by Martin Vysny (@mvysny) before opening this PR.