Skip to content

Commit 52d21f4

Browse files
fix: select bug inside form (#457)
1 parent 4069938 commit 52d21f4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/raystack/components/select/select-root.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ export const SelectRoot = (props: SelectRootProps) => {
133133

134134
const setValue = useCallback(
135135
(value: string) => {
136+
/*
137+
* If the select is placed inside a form, onChange is called with an empty value
138+
* WORKAROUND FOR ISSUE https://github.com/radix-ui/primitives/issues/3135
139+
*/
140+
if (value === '') return;
141+
136142
if (multiple) {
137143
updateSelectionInProgress(true);
138144
const set = new Set<string>(

0 commit comments

Comments
 (0)