-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure selected value is an option after option changed and react …
…to value property changes even if tracking value internally (#914) * make sure selected tracked value is an option if possible Before this case did not work correctly: - Select was rendered with *no* options, but *with* a saved value - Options were fetched by ajax and options prop was updated - Reduce function if passed What happens without this commit is that the selected tracked value simply was the raw reduced value (previously saved). Which means that displaying a label for example does not work if the label comes from the unreduced option. This commit makes sure that the internal tracked value is checked against all options not only once the select is created but additionally when options change. * remove useless keys - first key was always undefined - second key was always the index which is not usefull at all since it changes based on the order * add test for setting value after option changed * correctly react to value property changes if tracking internally fixes #855, #842 * add getOptionKey prop * yarn upgrade doc * add getOptionKey api doc and fix links * yarn upgrade * do not use key on slot * fix label spec
- Loading branch information
Showing
7 changed files
with
3,829 additions
and
4,052 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.