fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Controlled TagPicker prints uncontrolled <> controlled switch React warning

Open nse7ens opened this issue 9 years ago • 1 comments

Bug Report

  • Package version(s): 4.37.5

Describe the issue:

When using the TagPicker, I receive the following message:

Warning: t is changing an uncontrolled input of type undefined to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa)...

My TagPicker is defined like this:

<TagPicker
  itemLimit={this.props.multi ? Infinity : 1}
  onResolveSuggestions={this._onFilterChanged.bind(this)}
  selectedItems={this.props.value}
  onChange={this.props.onChange.bind(this)}
/>

props.value is set by the parent's component state.value, which is being updated in the passed in props.onChange function.

nse7ens avatar Aug 29 '17 10:08 nse7ens

I believe PR https://github.com/OfficeDev/office-ui-fabric-react/pull/3006 should have fixed this issue. Please reply if issues remain

erichdev avatar Oct 16 '17 21:10 erichdev