question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dropdown throws Uncaught TypeError: Cannot set property 'tabIndex' of null when rendered in reactjs

See original GitHub issue

Dropdown 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 capture

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:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

5reactions
sajadghobadicommented, May 19, 2019

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();

2reactions
notebkcommented, Sep 19, 2018

@SandeepVattapparambil Got it, thanks for that explanation!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found