You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EuiDataGrid][a11y] When cell popover contains interactive children, opening and closing the cell popover strands focus #5646
Click any Date or Amount cell (any cell that does not have cell actions or interactive popover children)
Press the Enter key to open the popover
Press the Escape key to close the popover
Notice that focus is correctly restored back to the cell that opened the popover
Click any Account or Name cell (any cell that has cell actions or interactive popover children)
Press the Enter key to open the popover
Press the Escape key to close the popover
Notice that focus is not restored back to the cell that opened the popover but instead was returned to the entire document body
Browser info
I was testing in Safari+VO, but this happens in Safari without VO on (EDIT: or does it?? it appears not??). On Firefox I've experienced this intermittently and can't seem to isolate why, sometimes cell popover refocus works perfectly and other times it doesn't. It doesn't appear to happen for me on Chrome.
Thoughts/approach
I suspect FocusTrap is the underlying issue for this, but it looks like there's no difference in testing between 47.0.0 (the react and focus-trap upgrade) and 42.0.0 (a random old datagrid release) so it's unlikely that it's a recent issue. I'll probably work to address this at the data grid level rather than the focus trap level.
@1Copenut if you have a quick second, I'd love it if you could confirm that you can repro the above issue! I'm getting some inconsistent results and I'm not sure if I'm hallucinating or not.
@constancecchen I'm able to recreate the issue you described, with some interesting caveats:
Safari sets and returns focus correctly on Date and Account cells when VoiceOver is not running
Safari sets and returns focus correctly on Date cells when VoiceOver is running
Safari fails to return focus correctly on Account cells when VoiceOver is running
It's this third item that has my curiosity piqued. Focus is set on the <body> tag best I can gather when I press ESC on an account cell. I can't say if it's a timing issue, or VoiceOver interrupting an event handler, or something else.
I can repro those behaviors/conditions exactly. Thanks a million Trevor! Super bizarre that VO would affect the focus behavior - I wonder if we need to do more QA testing with VO + EuiPopover across the board 😬 (hopefully not!)
When VO is open, it takes hitting the escape key twice rapidly to close the popover (not sure why)
Even without any interactive children closing the popover strands focus back onto the top of the document and not to the triggering element
I'm not sure when this started happening, but I think unfortunately we have to solve this at the popover level, as this affects multiple datagrid popovers (e.g. toolbars, not just cells).
We're widening the technology scope to see if this is a general bug or a browser specific one. Will check off browser + screen reader pairs as they're tested with a note if the Popover behavior linked in previous comment passes or fails.
Testing Methodology
Start screen reader of choice
Open URL in browser
Arrow or tab to buttons
Press Enter or Ctrl + Opt + Space or tap to open a popover
Press Esc to close the popover
Assert focus is returned to the originating button
Open the popover again, and navigate to text inside it
The focus is being properly returned to the button with JAWS and NVDA. I am not sure this is something we need to worry about in VoiceOver due to the way Voiceover works. Voiceover treats a web page as a hierarchical structure. When you are in a table and are navigating its cells, and when you trigger a modal, VoiceOver does not always go back to the specific cell you were in but goes to the higher layer (the table itself). You could mitigate this behaviour in one of two ways: turn on Quick Navigation mode by pressing left and right arrows together and use the arrow keys to navigate and up and down arrow together to simulate the enter key, or enable keyboard navigation in the voiceover utility under the web navigation category (the latter is discouraged as you will see in the popup that shows up when you try to enable it). I'd be happy to demonstrate if needed.
Interesting, thank you @zuhairmahd for testing and providing this explanation of how VO defines page structure.
I'm not sure to call this a bug or just a quirk in how VoiceOver organizes things. The EuiPopover doesn't return focus when I use arrow keys to listen to the content inside the modal, but does handle focus correctly when the popover is inside a modal like our EuiFlyout component.
At any rate, we have determined this is a Safari + VoiceOver specific item. I'd like to standardize behavior if we can, with understanding this might be a backlog or longer-tail item.
Activity
cee-chen commentedon Feb 17, 2022
@1Copenut if you have a quick second, I'd love it if you could confirm that you can repro the above issue! I'm getting some inconsistent results and I'm not sure if I'm hallucinating or not.
1Copenut commentedon Feb 22, 2022
@constancecchen I'm able to recreate the issue you described, with some interesting caveats:
DateandAccountcells when VoiceOver is not runningDatecells when VoiceOver is runningAccountcells when VoiceOver is runningIt's this third item that has my curiosity piqued. Focus is set on the
<body>tag best I can gather when I pressESCon an account cell. I can't say if it's a timing issue, or VoiceOver interrupting an event handler, or something else.cee-chen commentedon Feb 22, 2022
I can repro those behaviors/conditions exactly. Thanks a million Trevor! Super bizarre that VO would affect the focus behavior - I wonder if we need to do more QA testing with VO + EuiPopover across the board 😬 (hopefully not!)
cee-chen commentedon Feb 23, 2022
@1Copenut So unfortunately I can reproduce this on almost all buttons on https://elastic.github.io/eui/#/layout/popover, even ones without interactive children for some reason.
I'm not sure when this started happening, but I think unfortunately we have to solve this at the popover level, as this affects multiple datagrid popovers (e.g. toolbars, not just cells).
1Copenut commentedon Feb 24, 2022
We're widening the technology scope to see if this is a general bug or a browser specific one. Will check off browser + screen reader pairs as they're tested with a note if the Popover behavior linked in previous comment passes or fails.
Testing Methodology
EnterorCtrl + Opt + Spaceor tap to open a popoverEscto close the popoverTest Group 1
https://elastic.github.io/eui/#/layout/popover
Test Group 2
https://elastic.github.io/eui/#/layout/modal
Test Group 3
https://elastic.github.io/eui/#/layout/flyout
cee-chen commentedon Feb 24, 2022
A few more major FocusTrap usages that would be awesome to test:
1Copenut commentedon Feb 24, 2022
I'll add those as test groups after an early lunch break
zuhairmahd commentedon Feb 24, 2022
The focus is being properly returned to the button with JAWS and NVDA. I am not sure this is something we need to worry about in VoiceOver due to the way Voiceover works. Voiceover treats a web page as a hierarchical structure. When you are in a table and are navigating its cells, and when you trigger a modal, VoiceOver does not always go back to the specific cell you were in but goes to the higher layer (the table itself). You could mitigate this behaviour in one of two ways: turn on Quick Navigation mode by pressing left and right arrows together and use the arrow keys to navigate and up and down arrow together to simulate the enter key, or enable keyboard navigation in the voiceover utility under the web navigation category (the latter is discouraged as you will see in the popup that shows up when you try to enable it). I'd be happy to demonstrate if needed.
1Copenut commentedon Feb 24, 2022
Interesting, thank you @zuhairmahd for testing and providing this explanation of how VO defines page structure.
I'm not sure to call this a bug or just a quirk in how VoiceOver organizes things. The
EuiPopoverdoesn't return focus when I use arrow keys to listen to the content inside the modal, but does handle focus correctly when the popover is inside a modal like ourEuiFlyoutcomponent.At any rate, we have determined this is a Safari + VoiceOver specific item. I'd like to standardize behavior if we can, with understanding this might be a backlog or longer-tail item.