Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Estimate and tag on goal creation form don't close #1391

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/components/EstimateComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ export const EstimateComboBox = React.forwardRef<HTMLDivElement, EstimateComboBo
onChange?.(undefined);
}, [defaultValuePlaceholder, text, onChange, setInputState, value?.date, locale]);

const onClickOutside = useCallback((cb: () => void) => cb(), []);

return (
<ComboBox
ref={ref}
Expand All @@ -235,6 +237,7 @@ export const EstimateComboBox = React.forwardRef<HTMLDivElement, EstimateComboBo
items={Object.keys(quarterInfo)}
maxWidth={100}
minWidth={100}
onClickOutside={onClickOutside}
onChange={onChange}
renderTrigger={(props) => (
<StyledTriggerContainer>
Expand All @@ -247,7 +250,7 @@ export const EstimateComboBox = React.forwardRef<HTMLDivElement, EstimateComboBo
/>
</StyledTriggerContainer>
)}
renderInput={() => (
renderInput={({ ref }) => (
<InputMask mask={mask} maskPlaceholder={null} onChange={onInputChange} value={inputState}>
{/* @ts-ignore incorrect type in react-input-mask */}
{(props: { value: string; onChange: () => void }) => (
Expand All @@ -256,6 +259,7 @@ export const EstimateComboBox = React.forwardRef<HTMLDivElement, EstimateComboBo
placeholder={placeholder}
value={props.value}
onChange={props.onChange}
ref={ref}
/>
)}
</InputMask>
Expand Down
3 changes: 3 additions & 0 deletions src/components/TagComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export const TagComboBox = React.forwardRef<HTMLDivElement, TagComboBoxProps>(
]
: [];

const onClickOutside = useCallback((cb: () => void) => cb(), []);

return (
<ComboBox
ref={ref}
Expand All @@ -86,6 +88,7 @@ export const TagComboBox = React.forwardRef<HTMLDivElement, TagComboBoxProps>(
visible={completionVisible}
error={error}
disabled={disabled}
onClickOutside={onClickOutside}
onChange={onTagClick}
items={items}
renderTrigger={(props) => (
Expand Down
Loading