Dropdown throws Uncaught TypeError: Cannot set property 'tabIndex' of null when rendered in reactjs
See original GitHub issueDropdown throws an Uncaught TypeError: Cannot set property 'tabIndex' of null
when rendered in reactjs.
Expected Behavior
Its supposed to be rendered properly without throwing any error
Current Behavior
This is what we get
Steps to Reproduce (for bugs)
you can use the below code to reproduce the bug https://github.com/reactMaterial/react-material/blob/master/src/components/app-dropdown/Dropdown.js
Context
Trying to create a generalized reactjs component
Your Environment
- Version used: 1.0.0
- Browser Name and version: chrome Version 68.0.3440.106 (Official Build) (64-bit)
- Operating System and version (desktop or mobile): Windows 10
- Link to your project (if appropriate): https://github.com/reactMaterial/react-material
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Materialize: Cannot set property 'tabIndex' of null at Dropdown ...
I just stumbled this issue too while using Materializecss for my Vue project. As mentioned by sajjad, using id selector instead of class...
Read more >Fix Cannot Set Property of Null Error in JavaScript - YouTube
Check us out at https://www.skillforge.com The " cannot set property of null " error is a very common JavaScript issue that you may...
Read more >cannot read properties of null (reading '0') react - You.com
Solution: The TypeError: Cannot read properties of null (reading 'data') occurs when your first render, your data with that id isn't mounted to...
Read more >API - React Select
A flexible and beautiful Select Input control for ReactJS with multiselect, autocomplete and ajax support.
Read more >Uncaught Typeerror: This.Dropdownel Is Null When Initializing ...
Dropdown throws an Uncaught TypeError: Cannot set property 'tabIndex' of null when rendered in reactjs. Expected Behavior Its supposed to be.
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
use id selector instead class selector. for example call dropdown like this : html:
<a class='dropdown-trigger' id="dropdowner" href='#' data-target='dropdown1'>Drop Me!</a> <ul id='dropdown1' class='dropdown-content'> <li><a href="#!">one</a></li> <li><a href="#!">two</a></li> <li class="divider" tabindex="-1"></li> <li><a href="#!">three</a></li> <li><a href="#!"><i class="material-icons">view_module</i>four</a></li> <li><a href="#!"><i class="material-icons">cloud</i>five</a></li> </ul>
js :
$('#dropdowner').dropdown();
@SandeepVattapparambil Got it, thanks for that explanation!