React-select: onInputChange() result is not used

Created on 10 Mar 2017  路  1Comment  路  Source: JedWatson/react-select

This code:
https://github.com/JedWatson/react-select/blob/master/src/Async.js#L151

              if (ignoreAccents) {
            inputValue = stripDiacritics(inputValue);
        }

        if (ignoreCase) {
            inputValue = inputValue.toLowerCase();
        }

        if (onInputChange) {
            onInputChange(inputValue);
        }

        return this.loadOptions(inputValue);

should be

              if (ignoreAccents) {
            inputValue = stripDiacritics(inputValue);
        }

        if (ignoreCase) {
            inputValue = inputValue.toLowerCase();
        }

        if (onInputChange) {
            **inputValue** = onInputChange(inputValue);
        }

        return this.loadOptions(inputValue);

Most helpful comment

Creatable.js onInputChange has same issue:
https://github.com/JedWatson/react-select/blob/master/src/Creatable.js#L172

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;
},

>All comments

Creatable.js onInputChange has same issue:
https://github.com/JedWatson/react-select/blob/master/src/Creatable.js#L172

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;
},
Was this page helpful?
0 / 5 - 0 ratings

Related issues

AchinthaReemal picture AchinthaReemal  路  3Comments

x-yuri picture x-yuri  路  3Comments

sampatbadhe picture sampatbadhe  路  3Comments

geraldfullam picture geraldfullam  路  3Comments

MalcolmDwyer picture MalcolmDwyer  路  3Comments