BaseAutoFill in BasePicker does not update display value as expected
Bug Report
Recreate this issue as it is not fixed yet.
Priorities and help requested (not applicable if asking question):
Are you willing to submit a PR to fix? No
Requested priority: Normal
Products/sites affected: (if applicable)
Describe the issue:
when we use up/down arrow key to switch between items in suggestion list, the displayed value in input area doesn't change when datasource has resolved our input query correctly.
Actual behavior:
I look into the reason of it. In BaseAutoFill, there is some actions taken before render() function is called:
public componentWillReceiveProps(nextProps: IBaseAutoFillProps) {
if (this._autoFillEnabled && this._doesTextStartWith(nextProps.suggestedDisplayValue, this._value)) {
this.setState({ displayValue: nextProps.suggestedDisplayValue });
}
}
It will check whether the resolved result begins with query or not ant then setState, which means when my input is 'luh', and the datasource resolve it as 'Elika Luhur (Adecco)', the result won't be updated and displayed in input area. This is not what we expect.
Expected behavior:
If the result is mapped in the middle of the text, don't auto fill it.
If applicable, please provide a codepen repro:
Please try the codepen with the [email protected]: You can enter a, let select goes to second person and then back to first person. http://codepen.io/lingge/pen/MmgbBG
Updated codepen. Seems the latter one is broken.
Closing, don't think this is an issue anymore. Please reopen if you still experience issues