-
Notifications
You must be signed in to change notification settings - Fork 72
Closed
Description
Describe your motivation
In #4752 the ContextMenuOverlayElement
was added and it is used like this:
Lines 199 to 201 in 75ad927
private ContextMenuOverlayElement getOverlay() { | |
return $(ContextMenuOverlayElement.class).first(); | |
} |
This can be problematic in the future as in V25 we'll switch to native popover
and the vaadin-context-menu-overlay
element will no longer be teleported to the <body>
but instead will always stay inside vaadin-context-menu
(either in shadow or light DOM, that's yet to be discussed separately).
Describe the solution you'd like
- Consider removing the
ContextMenuOverlayElement
altogether - Move methods
getMenuItem(String caption)
andgetMenuItems()
toContextMenuElement
- Add
getOverlay()
to theContextMenuElement
usinggetPropertyElement("_overlayElement")
- This can return
TestBenchElement
, see e.g.DialogElement
- it's there but is private - See also DialogElement should have a helper method for querying the overlay element #3677
- This can return
- Optionally, also consider updating the
openByRightClick()
helper to returngetOverlay()
Lines 43 to 45 in 75ad927
public static void openByRightClick(TestBenchElement target) { | |
target.contextClick(); | |
} |
Additional context
The API has to be then backported to v23 in #4754