Skip to content

Commit

Permalink
fix: avoid an unnecessary focus call
Browse files Browse the repository at this point in the history
  • Loading branch information
tomivirkki committed Nov 8, 2023
1 parent bca0100 commit 9fa0038
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/grid-pro/src/vaadin-grid-pro-edit-column-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,13 @@ export const GridProEditColumnMixin = (superClass) =>
editor._grid = this._grid;

this._focusEditor(editor);
requestAnimationFrame(() => this._focusEditor(editor));
requestAnimationFrame(() => {
// Ensure editor is focused after an animation frame
const editorIsFocused = editor.contains(editor.getRootNode().activeElement);
if (!editorIsFocused) {
this._focusEditor(editor);
}
});
}

/**
Expand Down

0 comments on commit 9fa0038

Please sign in to comment.