We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 43617f4 commit 29d3499Copy full SHA for 29d3499
2 files changed
.changeset/wicked-goats-speak.md
@@ -0,0 +1,5 @@
1
+---
2
+'@cube-dev/ui-kit': patch
3
4
+
5
+Fix ComboBox behavior outside the form.
src/components/fields/ComboBox/ComboBox.tsx
@@ -329,11 +329,14 @@ export const ComboBox = forwardRef(function ComboBox<T extends object>(
329
330
// If input is not full and the user presses Enter, pick the first option.
331
let onKeyPress = useEvent((e: KeyboardEvent) => {
332
+ if (!props.onSelectionChange) {
333
+ return;
334
+ }
335
336
if (e.key === 'Enter') {
337
if (!props.allowsCustomValue) {
338
if (state.isOpen) {
339
const option = [...state.collection][0]?.key;
-
340
if (option && selectedKey !== option) {
341
props.onSelectionChange?.(option);
342
0 commit comments