fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

BaseAutoFill in BasePicker does not update display value as expected

Open MirandaGe opened this issue 9 years ago • 2 comments

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

MirandaGe avatar Apr 17 '17 04:04 MirandaGe

Updated codepen. Seems the latter one is broken.

MirandaGe avatar May 16 '17 11:05 MirandaGe

Closing, don't think this is an issue anymore. Please reopen if you still experience issues

erichdev avatar Oct 12 '17 19:10 erichdev