Skip to content
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

fix(spatial-navigation): focus lost in error modal #8817

Merged
merged 11 commits into from
Jul 29, 2024

Conversation

CarlosVillasenor
Copy link
Contributor

Description

The spatial-navigation is unable to focus certain elements of the error modal when this appears, this PR will fix that

Specific Changes proposed

Allow the spatial-navigation to focus certain non-component elements in the error modal

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chrome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
    • Has no DOM changes which impact accessiblilty or trigger warnings (e.g. Chrome issues tab)
    • Has no changes to JSDoc which cause npm run docs:api to error
  • Reviewed by Two Core Contributors

@CarlosVillasenor CarlosVillasenor changed the title fix(spatial navigation): focus lost in error modal fix(spatial-navigation): focus lost in error modal Jul 25, 2024
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.80%. Comparing base (76e99b7) to head (84dbb11).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8817      +/-   ##
==========================================
+ Coverage   83.68%   83.80%   +0.11%     
==========================================
  Files         120      120              
  Lines        8030     8050      +20     
  Branches     1927     1930       +3     
==========================================
+ Hits         6720     6746      +26     
+ Misses       1310     1304       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CarlosVillasenor CarlosVillasenor marked this pull request as ready for review July 26, 2024 19:57
@CarlosVillasenor CarlosVillasenor merged commit daf40bd into main Jul 29, 2024
14 checks passed
@CarlosVillasenor CarlosVillasenor deleted the fix/spatial-navigation-focus-lost branch July 29, 2024 18:12

// Focus the buttons of the modal
if (this.focusableComponents.length > 1) {
this.focusableComponents[1].focus();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Why do we focus 2nd element here, not first?
  • What if a modal has exactly one focusable element? (this if statement does not cover this case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants