Skip to content

fix(Carousel): fixed re-focus to opposite navigation button in 2 card edge case #34689

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mathis-m
Copy link
Contributor

Previous Behavior

When having 2 slides in the carousel either the prev or next button is disabled.
The current behavior does a re-focus from one to the other button if clicked/invoked if certain conditions are met(not relevant for this fix).

The focus call happend syncronously with the invoke. This led to the opposite button not receiving focused as it is still disabled.

New Behavior

Changed the focus call to be executed after layout is resolved by using requestAnimationFrame.

Related Issue(s)

@mathis-m mathis-m requested review from Mitch-At-Work and a team as code owners June 20, 2025 16:34
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.

[Bug]: Keyboard focus loss in Carousel when there are only 2 CarouselCard
1 participant