Skip to content

Commit

Permalink
fix: dropdown notopening if user clicks on dropdown backdrop
Browse files Browse the repository at this point in the history
  • Loading branch information
tewarig committed Nov 15, 2024
1 parent c06660f commit 154be26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/blade/src/components/Input/BaseInput/BaseInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,10 @@ type BaseInputCommonProps = FormInputLabelProps &
* @default true
**/
isTableInputCell?: boolean;

/**
* Callback to be invoked when the backdrop is clicked
*/
onBackdropClick?: () => void;
/**
* Hides the form hints and shows them as tooltip of trailing
*/
Expand Down Expand Up @@ -825,6 +828,7 @@ const _BaseInput: React.ForwardRefRenderFunction<BladeElementRef, BaseInputProps
valueComponentType = 'text',
isTableInputCell = false,
showHintsAsTooltip = false,
onBackdropClick,
...styledProps
},
ref,
Expand Down Expand Up @@ -971,6 +975,7 @@ const _BaseInput: React.ForwardRefRenderFunction<BladeElementRef, BaseInputProps
if (!isReactNative) {
inputRef.current?.focus();
}
onBackdropClick?.();
}}
isTableInputCell={isTableInputCell}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ const _BaseDropdownInputTrigger = (
onChange={props.isSelectInput ? undefined : props.onInputValueChange}
onKeyDown={props.onTriggerKeydown}
size={props.size}
onBackdropClick={onTriggerClick}
trailingInteractionElement={
isAutoCompleteInHeader || (isInsideTableEditableCell && !isValidationStateNone) ? null : (
<InputChevronIcon
Expand Down

0 comments on commit 154be26

Please sign in to comment.