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

TabIndex hardcoded to 0 #130

Open
1ak31sha opened this issue Apr 20, 2021 · 3 comments
Open

TabIndex hardcoded to 0 #130

1ak31sha opened this issue Apr 20, 2021 · 3 comments

Comments

@1ak31sha
Copy link

1ak31sha commented Apr 20, 2021

hi, i was facing an issue using lottie when my animation was presentational only but it was becoming tabbable due to the hardcoded tabindex = 0

tabIndex="0"

i saw this existing issue #67 which proposed spreading the props and wondering if that could be added or create a new prop/configuration for setting the tabindex.

currently my workaround is something like

    const removeTabIndexFromLottie = (id: string) => {
      const lottieDiv = document.querySelector<HTMLElement>(
        `.Toggle-focusableContainer div[title=${id}]`
      );
      if (lottieDiv) {
        lottieDiv.tabIndex = -1;
      }
    };

but we prefer not to have to do stuff like this, i think the above issue&solution is much cleaner

btw, my first time using react-lottie and i love it! <3

@ghost
Copy link

ghost commented Aug 31, 2021

Hello. You can use this.
https://www.npmjs.com/package/react-lottie-wrapper.
Example:
<Lottie tabIndex={-1} options={ defaultOptions } />

@hugotox
Copy link

hugotox commented Mar 24, 2023

This doesn't work. tabIndex is not a prop for Lottie components

Property 'tabIndex' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Lottie> & Readonly<LottieProps> & Readonly<{ children?: ReactNode; }>'.

@101budspencer
Copy link

Any solution?

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

No branches or pull requests

3 participants