-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove previous workaround and adopt the `selectedItem` prop to make the `ComboBox` component fully controlled. To avoid the previous issue where the ComboBox would get into a loop or cause the tests to crash due to OOM, we memoise the value passed to `selectedItem` to ensure the same reference is kept if the value is unchanged, e.g. in case of a selected namespace: `{ id: namespace, text: namespace }` we memoise on the `id` field so the same object is returned unless the namespace changes. This avoid the ComboBox unnecessarily re-rendering, and also handles the case of translated text for the 'All namespaces' option.
- Loading branch information
1 parent
663c37b
commit 5d90112
Showing
4 changed files
with
28 additions
and
16 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
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