From 12eab7ab40c017fea6312cd6eb88d9f35a7a0636 Mon Sep 17 00:00:00 2001 From: Daniil Savitskii Date: Sun, 15 Dec 2024 22:11:39 +0400 Subject: [PATCH] fixes isTyping flag on tab press --- packages/@headlessui-react/src/components/combobox/combobox.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/@headlessui-react/src/components/combobox/combobox.tsx b/packages/@headlessui-react/src/components/combobox/combobox.tsx index cebbb74bb..ad5a0c004 100644 --- a/packages/@headlessui-react/src/components/combobox/combobox.tsx +++ b/packages/@headlessui-react/src/components/combobox/combobox.tsx @@ -848,6 +848,7 @@ function ComboboxFn { dispatch({ type: ActionTypes.CloseCombobox }) + actions.setIsTyping(false) defaultToFirstOption.current = false onClose?.() }) @@ -1282,6 +1283,7 @@ function InputFn< return actions.closeCombobox() case Keys.Tab: + actions.setIsTyping(false) if (data.comboboxState !== ComboboxState.Open) return if (data.mode === ValueMode.Single && data.activationTrigger !== ActivationTrigger.Focus) { actions.selectActiveOption()