Skip to content

Commit

Permalink
[Fix] DRY out enableInteractives call
Browse files Browse the repository at this point in the history
Setting isCellEntered to true already makes that same call, so *should* have that same effect as long as we're consistent about changing logic via isCellEntered

This also fixes elastic#4384, which was a focus-lock issue caused focusin/focusout events firing multiple times. Now with the setIsCellEntered change, focus does not fire repeatedly
  • Loading branch information
cee-chen committed Sep 21, 2021
1 parent 6be8f53 commit ac5e058
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,8 @@ export const EuiDataGridHeaderCellWrapper: FunctionComponent<EuiDataGridHeaderCe
if (isFocused === false) {
setFocusedCell([index, -1]);
} else {
// this cell already had the grid's focus, so re-enable interactives
enableInteractives(headerNode);
// shift focus to the interactive element
focusInteractives(headerNode);
// this cell already had the grid's focus, so re-enable and focus interactives
setIsCellEntered(true);
}
}
}
Expand Down

0 comments on commit ac5e058

Please sign in to comment.