From 4a5adf57a3128e77876c43c7ed4b92dea623e153 Mon Sep 17 00:00:00 2001 From: DenisVorop Date: Thu, 27 Jul 2023 21:31:30 +0300 Subject: [PATCH] chore: add clickoutside listeners --- src/components/EstimateComboBox.tsx | 6 +++++- src/components/TagComboBox.tsx | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/EstimateComboBox.tsx b/src/components/EstimateComboBox.tsx index 72c55a330..2b60c8b30 100644 --- a/src/components/EstimateComboBox.tsx +++ b/src/components/EstimateComboBox.tsx @@ -224,6 +224,8 @@ export const EstimateComboBox = React.forwardRef void) => cb(), []); + return ( ( @@ -247,7 +250,7 @@ export const EstimateComboBox = React.forwardRef )} - renderInput={() => ( + renderInput={({ ref }) => ( {/* @ts-ignore incorrect type in react-input-mask */} {(props: { value: string; onChange: () => void }) => ( @@ -256,6 +259,7 @@ export const EstimateComboBox = React.forwardRef )} diff --git a/src/components/TagComboBox.tsx b/src/components/TagComboBox.tsx index 88da6d659..159e4ce30 100644 --- a/src/components/TagComboBox.tsx +++ b/src/components/TagComboBox.tsx @@ -78,6 +78,8 @@ export const TagComboBox = React.forwardRef( ] : []; + const onClickOutside = useCallback((cb: () => void) => cb(), []); + return ( ( visible={completionVisible} error={error} disabled={disabled} + onClickOutside={onClickOutside} onChange={onTagClick} items={items} renderTrigger={(props) => (