-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
COM-160: Fix clearable for FinalFormSelect with
multiple
(#1365)
When the `multiple` prop is set, the value is an array. Therefore, checking if the select has a value must be done with `array.length` and clearing the value must set it to an empty array instead of `undefined`.
- Loading branch information
1 parent
a9ebbde
commit eac9990
Showing
3 changed files
with
39 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@comet/admin": patch | ||
--- | ||
|
||
Fix the clear-button in `FinalFormSelect` when using it with the `multiple` prop. | ||
|
||
- The clear button is now only shown when at least one value is selected. | ||
- Clearing the value now sets it to an empty array instead of `undefined`, which would cause an error when trying to render the select. |
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