-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dropdown: Correctly updating set-size when number of options updates …
…after first render (#14415) #### Pull request checklist - [x] Addresses an existing issue: Fixes #14375 - [x] Include a change request file using `$ yarn change` #### Description of changes If options were added after the initial render of the `Dropdown` the `aria-setsize` attribute's value was not changing because the check to update the cache was being done in `UNSAFE_componentWillReceiveProps` where `newProps.options` was always the same as `this.props.options`. This PR fixes the issue by creating a cache of the options and comparing against this cache on subsequent renders. #### Focus areas to test (optional)
- Loading branch information
Showing
6 changed files
with
44 additions
and
12 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
change/@fluentui-react-next-2020-08-07-16-17-16-dropdownSizePosCache.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "Dropdown: Correctly updating set-size when number of options updates after first render.", | ||
"packageName": "@fluentui/react-next", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch", | ||
"date": "2020-08-07T23:17:16.796Z" | ||
} |
8 changes: 8 additions & 0 deletions
8
change/office-ui-fabric-react-2020-08-07-16-17-16-dropdownSizePosCache.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "Dropdown: Correctly updating set-size when number of options updates after first render.", | ||
"packageName": "office-ui-fabric-react", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch", | ||
"date": "2020-08-07T23:17:13.524Z" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters