Skip to content

Commit 1024cbd

Browse files
vaadin-botweb-padawanclaude
authored
fix: store composed path for deferred context menu open (#9645) (#9647)
Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9c0e762 commit 1024cbd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/main/resources/META-INF/frontend/contextMenuTargetConnector.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ function init(target) {
1313
}
1414
e.preventDefault();
1515
e.stopPropagation();
16+
// The menu is opened later, after a server round-trip, when the event has
17+
// finished dispatching and `composedPath()` returns an empty array. Capture
18+
// the composed path now so the menu can resolve the target inside a shadow
19+
// root (e.g. a grid cell) instead of the retargeted host.
20+
e.__composedPath = e.composedPath();
1621
this.$contextMenuTargetConnector.openEvent = e;
1722
let detail = {};
1823
if (target.getContextMenuBeforeOpenDetail) {

0 commit comments

Comments
 (0)