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

Focusable elements offscreen break layout. #506

Closed
1 task done
aa-jeremyhoover opened this issue Jun 21, 2023 · 3 comments
Closed
1 task done

Focusable elements offscreen break layout. #506

aa-jeremyhoover opened this issue Jun 21, 2023 · 3 comments
Labels
bug Something isn't working resolved This issue is resolved

Comments

@aa-jeremyhoover
Copy link

aa-jeremyhoover commented Jun 21, 2023

Bug is related to

  • embla-carousel (core package)

Embla Carousel version

  • v8.0.0-rc07

Describe the bug

When a slide offscreen contains a focusable link, users can tab to this hidden content and break the layout of the slider.

CodeSandbox

Here's a demo, pressing tab goes to a slide out of view and breaks the slide layout:
https://codesandbox.io/s/embla-carousel-default-react-forked-mfxmmy?file=/src/js/EmblaCarousel.jsx

Steps to reproduce

  1. Tab through elements on page
  2. Element out of view receives focus and breaks the layout. Which looks like this:
    image

Expected behavior

  1. Elements out of view shouldn't receive focus. They should still be accessible to keyboard users through navigation. As per this comment

Yes I believe that content of non-visible slides should not be tabable

@aa-jeremyhoover aa-jeremyhoover added the bug Something isn't working label Jun 21, 2023
@davidjerleke
Copy link
Owner

Hi @aa-jeremyhoover,

Try this solution. Let me know if it helps.

Best,
David

@aa-jeremyhoover
Copy link
Author

Thanks, that's what I needed :)

@davidjerleke
Copy link
Owner

Hi @aa-jeremyhoover,

Just wanted to let you know that as of v8.0.0-rc12 Embla handles this internally. No need to copy paste code to get this to work anymore.

Cheers,
David

@davidjerleke davidjerleke added the resolved This issue is resolved label Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved This issue is resolved
Projects
None yet
Development

No branches or pull requests

2 participants