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

Focus Zone, moving focus stops working upwards if hidden attribute is set to true of an element in the focus flow #257

Closed
1951FDG opened this issue Dec 14, 2023 · 5 comments · Fixed by #263
Assignees

Comments

@1951FDG
Copy link

1951FDG commented Dec 14, 2023

Moving focus stops working upwards if hidden attribute is set to true of an element in the focus flow

To reproduce:

I have button that I hide when it is clicked

Start moving focus downwards till button is reached, click that button, click handler will execute button.hidden = true;
moving focus downwards if further elements are present below the now hidden button works
moving focus upwards from where the button was previously displayed no longer works

So setting an element to hidden in the chain, disrupts the focus flow upwards starting from that element

@siddharthkp
Copy link
Member

Hi!

Thanks for taking the time to report this, do you mind creating adding a reproduction of the issue on codesandbox.io or stackblitz.com?

@1951FDG
Copy link
Author

1951FDG commented Dec 15, 2023

Hi!

Please use same fiddle as #258

To reproduce, click the "submit" button,

  • left arrow key to move focus to elements before the hidden button (will not work !)
  • use right arrow key to move focus to elements after the hidden button (will work)

@lesliecdubs
Copy link
Member

Thanks for reporting! We believe this is something that may have also been an issue in primer/view_components that was resolved by @TylerJDev. Tyler, does that sound familiar? If so, would you be willing to take a look at upstreaming that work into primer/behaviors as well?

@TylerJDev
Copy link
Member

Yup, this does sound similar to the issue that we fixed in PVC. I'll take a look to see if we can implement the same fix here.

@TylerJDev
Copy link
Member

This should be fixed with #263 merged, and will be available in our next release.

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

Successfully merging a pull request may close this issue.

4 participants