Package version(s): Not working on 7.71.0 and can repro on latest also.
Browser and OS versions: (fill this out if relevant)
Describe the issue:
On updating the options in props of the multi select dropdown, the _sizePosCache is not getting updated again. This is causing the component to break with the following error Unexpected: Option at index ${index} is not a selectable element.
Looking at the code in the Dropdown.base.tsx , why are we updating the cache in componentWillRecieveProps only for single select and not multi select ?
public UNSAFE_componentWillReceiveProps(newProps: IDropdownProps): void {
........... Some code ............
if (
newProps.options !== this.props.options && // preexisting code assumes purity of the options...
!newProps.multiSelect // only relevant in single selection
) {
this._sizePosCache.updateOptions(newProps.options);
}
}
Actual behavior:
Component is breaking down with the error mentioned above.
Expected behavior:
Component should render correctly with the new options in the props.
Environment Information
Describe the issue:
On updating the options in props of the multi select dropdown, the _sizePosCache is not getting updated again. This is causing the component to break with the following error
Unexpected: Option at index ${index} is not a selectable element.
Looking at the code in the Dropdown.base.tsx , why are we updating the cache in componentWillRecieveProps only for single select and not multi select ?
public UNSAFE_componentWillReceiveProps(newProps: IDropdownProps): void { ........... Some code ............
if ( newProps.options !== this.props.options && // preexisting code assumes purity of the options... !newProps.multiSelect // only relevant in single selection ) { this._sizePosCache.updateOptions(newProps.options); }
}
Actual behavior:
Component is breaking down with the error mentioned above.
Expected behavior:
Component should render correctly with the new options in the props.
If applicable, please provide a codepen repro:
Priorities and help requested (not applicable if asking question):
Are you willing to submit a PR to fix? (Yes, No) No
Requested priority: (Blocking, High, Normal, Low) Blocking/High
Products/sites affected: (if applicable) M365 Security and Compliance portal.