-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STUTL-48 exportCSV - render download link to OverlayContainer rather than document.body #91
Conversation
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deprecation notice on this component has been here for three years. We can include this fix in a Ramsons bugfix release if we think it's necessary, but if not, we should finally just delete this component.
## [STCOM-1387](https://folio-org.atlassian.net/browse/STCOM-1387) The focus-trapping logic of Modal (via `focus-trap`) causes the `click()` event not to trigger on the download link rendered by `ExportCSV` because the link is appended outside of the focus-trapped element (in the body.) Approach: Rendering the link within the `div#OverlayContainer` places it in within the `focus-trapping` boundary. Since this element is always present in the stripes UI, it's okay to render here. For tests where the `OverlayContainer` may not exist, the logic falls back to the body. Additionally, the `exportCSV` logic would simply click the link and then remove it. This may not cause the focus to move, but it's a safe accessibility measure to return focus to the element it was originally on prior to clicking the download trigger. A similar fix is required in `stripes-util` since we're not sure how many ui modules use THAT version of `ExportCSV`... That PR: folio-org/stripes-util#91
## [STCOM-1387](https://folio-org.atlassian.net/browse/STCOM-1387) The focus-trapping logic of Modal (via `focus-trap`) causes the `click()` event not to trigger on the download link rendered by `ExportCSV` because the link is appended outside of the focus-trapped element (in the body.) Approach: Rendering the link within the `div#OverlayContainer` places it in within the `focus-trapping` boundary. Since this element is always present in the stripes UI, it's okay to render here. For tests where the `OverlayContainer` may not exist, the logic falls back to the body. Additionally, the `exportCSV` logic would simply click the link and then remove it. This may not cause the focus to move, but it's a safe accessibility measure to return focus to the element it was originally on prior to clicking the download trigger. A similar fix is required in `stripes-util` since we're not sure how many ui modules use THAT version of `ExportCSV`... That PR: folio-org/stripes-util#91
@zburke yeah, we probably want to patch - a handful of places still use this... |
Related to folio-org/stripes-components#2400