Onchange event for <select> is not propagated in materialize css when not used with class "browser-default"
See original GitHub issueI use materialize css framework with react and had an issue on <select>
s onChange event propagation.
This way the event is not fired, this.handleSelectChange
is not called.
<select value="B" onChange={this.handleSelectChange}>
<option value="A">Apple</option>
<option value="B">Banana</option>
<option value="C">Cranberry</option>
</select>
When i add the class browser-default
to select
it works pretty well.
<select className="browser-default" value="B" onChange={this.handleSelectChange}>
<option value="A">Apple</option>
<option value="B">Banana</option>
<option value="C">Cranberry</option>
</select>
Not sure if it’s a react issue, but maybe. I also created an issue on materialize repo: https://github.com/Dogfalo/materialize/issues/1160
Issue Analytics
- State:
- Created 8 years ago
- Comments:21 (6 by maintainers)
Top Results From Across the Web
How to listen on <select> change events in materialize css
I am using materialize-css with angular7. This is how I have handled this <div class ...
Read more >Select - Materialize
Select allows user input through specified options. ... You can add the class browser-default to get the browser default. Browser Select.
Read more >Materialize CSS Dropdowns, Working with Dropdowns in ...
Materialize CSS provides dropdown facility, it provides several CSS classes to add a dropdown list to any button. Make sure that the data-activates ......
Read more >Team:Groningen/js/materialize - iGEM 2018
var jQuery; // Check if require is a defined function. if (typeof require ... by Materialize to confirm that Velocity is not already...
Read more >Forms - Materialize
Materialize is a modern responsive CSS framework based on Material Design by ... <div class="input-field col s12"> <input disabled value="I am not editable" ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top 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
here’s a clean way to do it:
if you’re using react < 0.14.0 you’ll have to use getDOMNode() on this.refs.yourSelectTag