Skip to content

Commit d6a2b98

Browse files
authored
fix: DH-22547: ESC cancels background row position (#2683)
Focuses the modal’s editor when opened so ESC is handled by the Modal’s window key handler. Restores grid focus after the modal closes for keyboard navigation.
1 parent edb965f commit d6a2b98

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

packages/iris-grid/src/IrisGrid.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4189,6 +4189,7 @@ class IrisGrid extends Component<IrisGridProps, IrisGridState> {
41894189
this.setState({
41904190
showOverflowModal: false,
41914191
});
4192+
this.grid?.focus(); // Focus on the grid after closing the overflow modal
41924193
}
41934194

41944195
handleOpenNoPastePermissionModal(errorMessage: string): void {

packages/iris-grid/src/IrisGridCellOverflowModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ export default function IrisGridCellOverflowModal({
117117
setHeight(contentHeight)
118118
);
119119
autoSetLineNumbers();
120+
(document.activeElement as HTMLElement)?.blur();
120121
}
121122

122123
if (!isOpen && !isOpened) {

packages/iris-grid/src/mousehandlers/IrisGridCellOverflowMouseHandler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ class IrisGridCellOverflowMouseHandler extends GridMouseHandler {
131131
showOverflowModal: true,
132132
overflowText: this.irisGrid.getValueForCell(column, row) as string,
133133
});
134+
return true; // Consume the event so GridSelectionMouseHandler doesn't clear the row selection
134135
}
135136

136137
return false;

0 commit comments

Comments
 (0)