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.

onChange not firing

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
edude03commented, Dec 2, 2017

I’m using React 16 and I’m noticing onChange isn’t firing for me either

0reactions
bladeycommented, May 27, 2020

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.

Read more comments on GitHub >

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

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