Skip to content

Commit

Permalink
pass event on right icon click
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsankhan26 committed Oct 1, 2024
1 parent 36d1951 commit 1965831
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ui/src/components/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export interface TextInputProps extends Omit<ComponentProps<"input">, "ref" | "c
color?: DynamicStringEnumKeysOf<FlowbiteTextInputColors>;
helperText?: ReactNode;
icon?: FC<ComponentProps<"svg">>;
onRightIconClick?: () => void;
onRightIconClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
rightIcon?: FC<ComponentProps<"svg">>;
shadow?: boolean;
sizing?: DynamicStringEnumKeysOf<FlowbiteTextInputSizes>;
Expand Down Expand Up @@ -87,7 +87,7 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(
<div
data-testid="right-icon"
className={`${theme.field.rightIcon.base} ${!onRightIconClick ? "pointer-events-none" : ""}`}
onClick={onRightIconClick}
onClick={(e) => onRightIconClick?.(e)}
>
<RightIcon className={theme.field.rightIcon.svg} />
</div>
Expand Down

0 comments on commit 1965831

Please sign in to comment.