Skip to content

Commit

Permalink
fix: detect moving focus to the overlay more reliably
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Sep 24, 2024
1 parent db59e2f commit 06b3795
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,10 @@ export const InlineEditingMixin = (superClass) =>
const { cell, column } = this.__edited;
const editor = column._getEditorComponent(cell);

const path = event.composedPath();
const nodes = path.slice(0, path.indexOf(editor) + 1).filter((node) => node.nodeType === Node.ELEMENT_NODE);
// Detect focus moving to e.g. vaadin-select-overlay or vaadin-date-picker-overlay
if (typeof editor._shouldRemoveFocus === 'function' && !editor._shouldRemoveFocus(event)) {
if (nodes.some((el) => typeof el._shouldRemoveFocus === 'function' && !el._shouldRemoveFocus(event))) {
return;
}
}
Expand Down

0 comments on commit 06b3795

Please sign in to comment.