Jump to content
Search Community

Element within scrollTrigger loses focus on ScrollTrigger.refresh()

BennyBee test
Moderator Tag

Recommended Posts

I'm trying to add keyboard navigation controls to an accordion component.

 

I have an element that is pinned with ScrollTrigger. Inside that element is a button which changes parts of the layout when clicked.


When I trigger a ScrollTrigger.refresh(); the button loses focus - is there a reason for this?

 

You can see it in the codepen (click in input, then use tab to focus button, then press enter to 'click' it)

 

My only solution is to manually focus the button after the refresh - but then this would show it as focussed for the non-keyboard users which isn't ideal.

 

Thanks!

See the Pen mdpeENE by bennyb (@bennyb) on CodePen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...