[EuiDataGrid] When a cell expansion popover is closed, ensure focus is always returned to the originating cell for keyboard users#5761
Conversation
24cc559 to
efaf0be
Compare
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5761/ |
2836072 to
9b007ae
Compare
9b007ae to
44d3016
Compare
|
Tested and confirmed that the last 2 added Cypress tests fail on main but pass on this branch. |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5761/ |
1Copenut
left a comment
There was a problem hiding this comment.
LGTM! I had one suggestion in the Cypress spec about using a Real Events method. If it makes sense to switch, let's do that, or if it's better as is, that's great too!
| cy.realMount(<EuiDataGrid {...baseProps} />); | ||
| cy.get( | ||
| '[data-gridcell-row-index="0"][data-gridcell-column-index="0"]' | ||
| ).click(); |
There was a problem hiding this comment.
What do you think about swapping these .click() events for .realClick() ones? https://github.com/dmtrKovalenko/cypress-real-events#cyrealclick
If that causes issues for clicks that need a { force: true } object, I'm okay sticking with the current implementation.
|
Ooo, it looks like |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5761/ |
Summary
This PR closes #5646 by manually returning
.focus()to the originating cell when a popover is closed by keyboard users (the escape key or the F2 key). This applies to two separate buggy use cases:Before
After
Checklist
- [ ] Checked in both light and dark modes- [ ] Checked in mobile- [ ] Props have proper autodocs and playground toggles- [ ] Added documentation- [ ] Checked Code Sandbox works for any docs examples- [ ] Checked for breaking changes and labeled appropriately- [ ] Updated the Figma library counterpart