onChange not firing
See original GitHub issueI have implemented the component, but the onChange is not firing no matter what I do.
My code looks like this:
<Select name='select-user' value={this.state.selectedUser} options={this.selectUserOptions} onChange={() => { alert('change!') }} placeholder='Selecteer een gebruiker' className='dark-select' />
I put the alert directly in the onChange property to make sure it isn’t a scoping issue with the logChange method. But even this alert doesn’t show.
I’ve used this component before and I’m familiar with it, which surprises me even more as this component has always functioned properly.
Any idea why the onChange doesn’t fire, even if I call the alert directly inside the onChange?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
html <input type="text" /> onchange event not working
I am trying to do some experiment. What I want to happen is that everytime the user types in something in the textbox,...
Read more >onChange not firing when input is populated by javascript?
onchange is not fired when the value of an input is changed. It is only changed when the input's value is changed and...
Read more >onChange not firing on controlled input element when value is ...
No change event is fired when input.value is updated, as there was technically no change event. This mirrors what React is doing. I...
Read more >The attribute for input tag"onchange" will not fire, but ...
onchange is only triggered when the control is out of focus. That means you have to click outside of the input field after...
Read more >javascript onchange handler for input box does not fire after ...
This bug is not a dup of bug 355367, although the cause may be the same. In this bug, the onkeyup handler isn't...
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’m using React 16 and I’m noticing onChange isn’t firing for me either
Hello -
In an effort to sustain the
react-select
project going forward, we’re closing old issues / pull requests.We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our limited efforts to maintain the latest version.
If you feel this issue / pull request is still relevant and you’d like us to review it, please leave a comment and we’ll do our best to get back to you.