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 event is not getting fired on react-select.

See original GitHub issue

<Select options={this.dropdownData} onChange={this.selectChangeHandler} styles={customStyles} components={{ MenuList: this.itemWrapper, Input: this.trigger }} key={title} closeMenuOnSelect={false} onInputChange={value => this.selectValue = value} placeholder={this.props.placeholder} filterOption={customFilter} isMulti isSearchable />

I am overriding both Input and MenuList components. For MenuList, I am using a virtualized list, but when I am making a selection, the onChange handler is not getting fired.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:13

github_iconTop GitHub Comments

7reactions
cmmv91commented, Apr 15, 2019

I’m having a similar issue, is not that onChange event is not firing but onBlur is firing first, causing onChange never to fire. We currently have a workaround by adding a timeout to onChange. The issue has been reproduced on Win 10 Pro and Home editions, and on Chrome, Firefox and Edge browsers. We haven’t found a pattern on how to reproduce it or why it happens, we will be trying to reproduce it on the sandbox above and share with you upon success. Please let us know if you have any questions regarding this issue.

1reaction
pulkitgoyal24commented, Jun 30, 2020

Is there any update on this issue. onChange on <Select> is working fine on mouse click but not working when press keyboard enter key in Chrome browser.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React select onChange is not working
This function is getting triggered only once when the select is loaded and subsequently when I change the value, its not getting triggered....
Read more >
Handle the onChange event on a Select element in React
To handle the onChange event on a select element in React, set the `onChange` prop on the select element. Keep the value of...
Read more >
Advanced
By explicitly passing you what type of change event has been fired, we allow you to have more granular control over how the...
Read more >
React Select Dropdown onChange Event Handler Tutorial
We'll help you learn how to build a select dropdown list. Also how to attach the onChange event handler to the select dropdown...
Read more >
HTMLElement: change event - Web APIs | MDN
The change event is fired for <input> , <select> , and <textarea> elements when the user modifies the element's value.
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