Skip to content

Commit 1965831

Browse files
committed
pass event on right icon click
1 parent 36d1951 commit 1965831

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/ui/src/components/TextInput/TextInput.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export interface TextInputProps extends Omit<ComponentProps<"input">, "ref" | "c
4646
color?: DynamicStringEnumKeysOf<FlowbiteTextInputColors>;
4747
helperText?: ReactNode;
4848
icon?: FC<ComponentProps<"svg">>;
49-
onRightIconClick?: () => void;
49+
onRightIconClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
5050
rightIcon?: FC<ComponentProps<"svg">>;
5151
shadow?: boolean;
5252
sizing?: DynamicStringEnumKeysOf<FlowbiteTextInputSizes>;
@@ -87,7 +87,7 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(
8787
<div
8888
data-testid="right-icon"
8989
className={`${theme.field.rightIcon.base} ${!onRightIconClick ? "pointer-events-none" : ""}`}
90-
onClick={onRightIconClick}
90+
onClick={(e) => onRightIconClick?.(e)}
9191
>
9292
<RightIcon className={theme.field.rightIcon.svg} />
9393
</div>

0 commit comments

Comments
 (0)