CreativeIT / getmdl-select

Select for material-design-lite
http://creativeit.github.io/getmdl-select/
MIT License
301 stars 87 forks source link

Suddenly stop working #70

Open anatamburus opened 6 years ago

anatamburus commented 6 years ago

The getmdl-select structure was working normally and suddenly stopped working.

When I click on the input to open the select it appears this error: Uncaught TypeError: Cannot set property 'value' of null at r (src\js\getmdl-select.js:59) at HTMLInputElement.t.onclick (src\js\getmdl-select.js:98) r @ src\js\getmdl-select.js:59 t.onclick @ src\js\getmdl-select.js:98

The list of data appears normal and when I click to choose the option appears these two errors: Uncaught TypeError: Cannot set property 'value' of null at d (src\js\getmdl-select.js:41) at HTMLLIElement.n.onclick (src\js\getmdl-select.js:175) d @ src\js\getmdl-select.js:41 n.onclick @ src\js\getmdl-select.js:175

Uncaught TypeError: Cannot set property 'value' of null at HTMLBodyElement.r (src\js\getmdl-select.js:59) r @ src\js\getmdl-select.js:59

What could have happened to suddenly stop working? Thanks

alexbananabob commented 6 years ago

@anatamburus, give please more information how it happened and how you using getmdl-select. Thanks

StartWebSolutions commented 6 years ago

Same here, suddenly it does not work

src\js\getmdl-select.js:59 Uncaught TypeError: Cannot set property 'value' of null
    at r (src\js\getmdl-select.js:59)
    at HTMLInputElement.t.onclick (src\js\getmdl-select.js:98)
r @ src\js\getmdl-select.js:59
t.onclick @ src\js\getmdl-select.js:98
2src\js\getmdl-select.js:59 Uncaught TypeError: Cannot set property 'value' of null
    at HTMLBodyElement.r (src\js\getmdl-select.js:59)

Lets me select a value in the list then all values disappear including the one selected.

Version before 29 dec works, loaded that one on local and tested.

alexbananabob commented 6 years ago

@anatamburus, @StartWebSolutions Version 2.0 does not have backwards compatibility with older ones. Make sure that you have updated all the files (js, html, css).

anatamburus commented 6 years ago

I found the difference. In the past I used the following structure <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label getmdl-select" style="margin-left: 20px;"> <input class="mdl-textfield__input" id="accountType" name="accountType" type="text" readonly tabIndex="-1"/> <label class="mdl-textfield__label" for="accountType">Account Type</label> <ul class="mdl-menu mdl-menu--bottom-left mdl-js-menu" for="accountType"> <li> </li> <li> </li> ..... <li> </li> </ul> </div>

I looked in the example that with a new version are two inputs, the second hidden. <input class="mdl-textfield__input" id="accountType" type="text" readonly tabIndex="-1"/> <input type="hidden" value="" name="accountType">

Apparently I was able to select the data in getmdl-select, but now I have another problem.

On the same page, other inputs that do not use getmdl-select are triggering the error: Uncaught TypeError: Cannot set property 'value' of null at HTMLBodyElement.r (src\js\getmdl-select.js:59) r @ src\js\getmdl-select.js:59