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

Include tabindex="-1" in all components #185

Closed
brunomonteirosud opened this issue Sep 20, 2019 · 2 comments
Closed

Include tabindex="-1" in all components #185

brunomonteirosud opened this issue Sep 20, 2019 · 2 comments

Comments

@brunomonteirosud
Copy link

brunomonteirosud commented Sep 20, 2019

Hi there!

I noticed that the <Tour /> component has a tabindex="-1" attribute, but not the buttons and other control components. The issue this is creating for me is: if I updated the state in a parent component and that causes a re-render in the child component, then the tabindex behavior in the child component get messed up.

I created a reproducible scenario here and I even opened a StackOverflow question about it, before realizing what the issue was.

Right now, my solution was to include this piece of code when the Tour opens:

setTimeout(() => {
    const elements = document.querySelectorAll("div[data-focus-lock-disabled] button");
    elements.forEach(el => el.tabIndex = "-1")
}, 100);

But it would be nice if the Tour components already had tabindex="-1" as default.

I am happy to go over the code and open a Pull Request for that, if necessary.

Thank you and congrats on the amazing library!

@brunomonteirosud brunomonteirosud changed the title Include "tabindex="-1" in all components Include tabindex="-1" in all components Sep 20, 2019
@elrumordelaluz
Copy link
Owner

elrumordelaluz commented Sep 20, 2019

Hi @brunomonteirosud, thanks for open the Issue.

Seems to be an issue with focuslock which is used to retain focus inside the Helper Component. Related #165

A possible solution is to have a flag to disable focuslock. Let me investigate and feel absolutely free to open a PR.

@bellsml
Copy link

bellsml commented Jan 31, 2020

@elrumordelaluz

A possible solution is to have a flag to disable focuslock. Let me investigate and feel absolutely free to open a PR.

#234

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