react-select icon indicating copy to clipboard operation
react-select copied to clipboard

Select.Async does not call onInputChange

Open bmamouri opened this issue 10 years ago • 5 comments

I am trying to implement this demo using Select.Async.

The event onInputChange does not call in the Select.Async component, but it works fine in the Select component itself.

bmamouri avatar Oct 06 '16 04:10 bmamouri

There was a fix with this. However, its not reflected in the code available through NPM. For right now I'm pointing dependency in package.json to github url.

kr0 avatar Oct 13 '16 12:10 kr0

I opted to use 1.0.0-rc.1 instead of rc.2

kr0 avatar Oct 13 '16 18:10 kr0

This seems to be still an issue in rc.2 downgrading to rc.1 works.

aminmc avatar Jan 03 '17 09:01 aminmc

I am seeing this issue as well for the Creatable component. The bug lies on these lines in that component:

onInputChange (input) {
	const { onInputChange } = this.props;

	if (onInputChange) {
		onInputChange(input);
	}

	// This value may be needed in between Select mounts (when this.select is null)
	this.inputValue = input;
}

Even though onInputChange() is called, the value is not returned. When I just use the Select component I am able to apply a masking function, whereas when using the Creatable component, that masking function value is never returned from the Creatable onInputChange call to the Select component. The function passed in as a prop is called, but the value is never returned up the call stack.

The correct code would look like this:

onInputChange (input) {
	const { onInputChange } = this.props;

	// This value may be needed in between Select mounts (when this.select is null)
	this.inputValue = input;

	if (onInputChange) {
		return onInputChange(input);
	}
}

cc: @JedWatson

mhubenthal avatar Feb 22 '17 20:02 mhubenthal

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.

bladey avatar May 27 '20 06:05 bladey