Skip to content

Commit

Permalink
Fix shift tab in table (#2654)
Browse files Browse the repository at this point in the history
* Fix shift tab in table

* fix

* Fix test

* fix build

---------

Co-authored-by: Bryan Valverde U <[email protected]>
  • Loading branch information
JiuqingSong and BryanValverdeU authored May 29, 2024
1 parent a642521 commit d7a4d8c
Show file tree
Hide file tree
Showing 3 changed files with 215 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,13 @@ class SelectionPlugin implements PluginWithState<SelectionPluginState> {
editor.getDOMHelper()
);

const rangeKey = key == Tab ? this.getTabKey(rawEvent) : key;

if (this.state.tableSelection) {
win?.requestAnimationFrame(() => this.handleSelectionInTable(rangeKey));
if (this.state.tableSelection && !rawEvent.defaultPrevented) {
if (key == Tab) {
this.handleSelectionInTable(this.getTabKey(rawEvent));
rawEvent.preventDefault();
} else {
win?.requestAnimationFrame(() => this.handleSelectionInTable(key));
}
}
}
break;
Expand Down
Loading

0 comments on commit d7a4d8c

Please sign in to comment.