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

TypeError: Cannot read properties of undefined (reading 'matches') #8

Closed
vincentfretin opened this issue Jul 21, 2022 · 2 comments · Fixed by #9
Closed

TypeError: Cannot read properties of undefined (reading 'matches') #8

vincentfretin opened this issue Jul 21, 2022 · 2 comments · Fixed by #9

Comments

@vincentfretin
Copy link
Contributor

solid-headless 0.12.1
I copied the Dialog demo in my app.
I have an issue with this code https://github.com/LXSMNSYC/solid-headless/blob/983581b93fc06169325703c8b0aa734ff349924a/packages/solid-headless/src/utils/focus-navigation.ts#L18

anchor is -1, so nodes[anchor] is undefined and so isFocusable(nodes[anchor]) is crashing with TypeError: Cannot read properties of undefined (reading 'matches')

@vincentfretin
Copy link
Contributor Author

From the logic in this code, I think you meant to use nodes[current] instead of nodes[anchor]

@lxsmnsyc
Copy link
Owner

Oh yeah, good catch

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 a pull request may close this issue.

2 participants