[WEB-5447] feat: add dataPreventOutsideClick prop to reafactor: ComboboxOptions for enhanced click handling #8112

This commit is contained in:
Jayash Tripathy 2025-11-17 19:47:48 +05:30 committed by GitHub
parent 6e32cb51b6
commit 06300d1a8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,6 +38,7 @@ export interface ComboboxOptionsProps {
searchQuery?: string;
onSearchQueryChange?: (query: string) => void;
onSearchQueryKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
dataPreventOutsideClick?: boolean;
}
export interface ComboboxOptionProps {
@ -111,6 +112,7 @@ function ComboboxOptions({
searchQuery: controlledSearchQuery,
onSearchQueryChange,
onSearchQueryKeyDown,
dataPreventOutsideClick,
}: ComboboxOptionsProps) {
// const [searchQuery, setSearchQuery] = React.useState("");
const [internalSearchQuery, setInternalSearchQuery] = React.useState("");
@ -164,6 +166,7 @@ function ComboboxOptions({
<BaseCombobox.Positioner sideOffset={8} className={positionerClassName}>
<BaseCombobox.Popup
className={cn("rounded-md border border-custom-border-200 bg-custom-background-100 p-1 shadow-lg", className)}
data-prevent-outside-click={dataPreventOutsideClick}
>
<div className="flex flex-col gap-1">
{showSearch && (