Cannot read property 'ownerDocument' of null
See original GitHub issueI’m getting this error thrown by the tabbable library which focus-trap-react depends on by way of focus-trap. At first I thought this might be a jest/enzyme problem but I’m also seeing it in non-test code.
TypeError: Cannot read property 'ownerDocument' of null
at tabbable (index.js:21)
at updateTabbableNodes (index.js:267)
at Object.activate (index.js:72)
at FocusTrap.componentDidMount (focus-trap-react.js:55)
I also noticed that the line that’s throwing this error is an older version than your most recent update of tabbable…perhaps a version update would help? I haven’t tested that yet, but I would love any input you have.
I’ve used this library before and had really great results with it, so thanks!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Cannot read property 'ownerDocument ...
I think my view is returning proper JSON but now data is not being added to the .mainContent div. It gives this error:...
Read more >Can not read property ownerDocument of null #542 - GitHub
I am getting TypeError: Cannot read property 'ownerDocument' of null even if all the required props are passed to Container and element.
Read more >Cannot read property 'ownerDocument' of undefined - Laracasts
I put a child component called <page-buttons> in my main Vue component. This component has some buttons floating on the page.
Read more >cannot read properties of null (reading 'ownerdocument')
I am getting TypeError: Cannot read property 'ownerDocument' of null even if all the required props are passed to Container and element. Line...
Read more >Cannot read property ownerDocument of null - Mendix Forum
actionButton2: Cannot read property 'ownerDocument' of null Error: An error occurred while executing On click at Linegenix.Location_NewEdit.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found that if the child of FocusTrap isn’t a HTML element then this error pops up.
E.g
Errors with
Cannot read property 'ownerDocument' of null
Works
You can see an example here. Make sure its set to current module view. And checkout
will-error.js
&works.js
@lukeschunk can you please be more specific about the situation in which this behavior is happening? This does not happen universally — for example, I’m not seeing it in the demos — so I think we need to identify what you and @pradel are doing that triggers the error.