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

Support using tab(focus) to select and navigate carousel #456

Closed
1 task done
Tracked by #321
winston0410 opened this issue Apr 14, 2023 · 6 comments · Fixed by #549
Closed
1 task done
Tracked by #321

Support using tab(focus) to select and navigate carousel #456

winston0410 opened this issue Apr 14, 2023 · 6 comments · Fixed by #549
Labels
feature request New feature or request resolved This issue is resolved

Comments

@winston0410
Copy link

winston0410 commented Apr 14, 2023

Feature request is related to

  • embla-carousel (core package)

Is your feature request related to an issue?

Right now when Tab is used to navigate, and if focusable element is located in the carousel, the slides will be navigated, but the embla.selectedScrollSnap is still 0.

Describe the solution you'd like

Listen on:focus and set selectedScrollSnap

Describe alternatives you've considered

I have tried to use on:focus event on those focusable element, and set the index with embla.scrollTo. But since focus event is only firing after an element received focus(i.e navigated to a new element), embla.scrollTo does not work well.

Basically, I think we need a method that manipulate embla.selectedScrollSnap without actually scrolling to that slide.

Additional context

Add any other context or screenshots about the feature request here.

@winston0410 winston0410 added the feature request New feature or request label Apr 14, 2023
@davidjerleke
Copy link
Owner

Please read the conversation and this.

@davidjerleke davidjerleke closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2023
@davidjerleke davidjerleke added duplicate This issue or pull request already exists and removed feature request New feature or request labels Apr 14, 2023
@winston0410
Copy link
Author

Hey David thanks you for your prompt reply. I have read that issue but I don't believe they are duplicate. Are you suggesting that using scrollNext or scollPrev is the solution here?

From what I can see, using Tab for navigation is not really the same with arrowkeys with keydown event, as we have to update after that navigation has happened, but for arrowkeys we are dealing with the event before that navigation on:keydown.

@davidjerleke
Copy link
Owner

Ah sorry about that @winston0410,

I was a bit too fast there. This was the comment I wanted to share. The title of the issue doesn't seem related though so I understand why you didn't find it 😄.

Best,
David

@winston0410
Copy link
Author

winston0410 commented Apr 14, 2023

Yes indeed that is not what I would have found with out your help, thank you so much. I have tried that plugin and seems like it is working well, except the type is a little bit off now. Would you accept a PR if I fix the type for that?

@davidjerleke davidjerleke added feature request New feature or request and removed duplicate This issue or pull request already exists labels Aug 3, 2023
@davidjerleke davidjerleke reopened this Aug 3, 2023
davidjerleke added a commit that referenced this issue Aug 3, 2023
davidjerleke added a commit that referenced this issue Aug 3, 2023
Support using tab(focus) to select and navigate carousel
@davidjerleke
Copy link
Owner

davidjerleke commented Aug 3, 2023

@winston0410 this feature will be released with v8.0.0-rc12.

@davidjerleke davidjerleke added the resolved This issue is resolved label Aug 3, 2023
@davidjerleke davidjerleke mentioned this issue Aug 3, 2023
37 tasks
@davidjerleke
Copy link
Owner

davidjerleke commented Aug 22, 2023

@winston0410 this feature has been released with v8.0.0-rc12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request resolved This issue is resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants