-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EuiDataGrid] Fix sorting console errors + header cell focus cleanup/…
…refactors (#5209) * [Fix] Fix console error when dragging to reorder columns * [Fix] DRY out enableInteractives call 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 #4384, which was a focus-lock issue caused focusin/focusout events firing multiple times. Now with the setIsCellEntered change, focus does not fire repeatedly * [Refactor] Remove unnecessary useEffect dependencies - now that we're not calling enableInteractives and focusInteractives directly but letting isCellEntered handle that for us, there's no need to include them + setIsCellEntered isn't necessary either/doesn't trigger the lint rule * [Refactor] Improve focus unit tests - Separate focus tests for isFocused logic vs focusin / focusout events * [Refactor] Move interactive fns to separate/external fns vs. useCallback - Removes the need for useCallback and setting the utility fns as dependencies, simplifying code - refactor for loops to forEach's - remove setIsCellEntered(true) in focusInteractables, since it now only gets called when isCellEntered is true * [Refactor] Combine enable and focus interactives action - they don't get called separately, so it makes sense to optimize the call and not make an extra tabbables call (+ reduces unnecessary branching) * [Refactor] More complete multiple interactive children unit tests - covers last uncovered branch in file - move to bottom of the file rather than top, since after talking to Chandler this is an edge case that only applies to control header cells + remove `data-euigrid-tab-managed` attr - tests should pass without it * [Refactor] Misc cleanup - convert functions to arrow functions - use shorter headerNode var instead of ref * [Fix] Remove F2 key event - it's had no effect since we switched header cells to use a popover for actions * Add changelog entry * Update changelog
- Loading branch information
Constance
authored
Sep 27, 2021
1 parent
7d1bbc5
commit 6fe740c
Showing
4 changed files
with
154 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.