diff --git a/packages/ui/src/components/TextInput/TextInput.tsx b/packages/ui/src/components/TextInput/TextInput.tsx index b651c852d..7bfe5b3f7 100644 --- a/packages/ui/src/components/TextInput/TextInput.tsx +++ b/packages/ui/src/components/TextInput/TextInput.tsx @@ -46,6 +46,7 @@ export interface TextInputProps extends Omit, "ref" | "c color?: DynamicStringEnumKeysOf; helperText?: ReactNode; icon?: FC>; + onRightIconClick?: (e: React.MouseEvent) => void; rightIcon?: FC>; shadow?: boolean; sizing?: DynamicStringEnumKeysOf; @@ -60,6 +61,7 @@ export const TextInput = forwardRef( color = "gray", helperText, icon: Icon, + onRightIconClick, rightIcon: RightIcon, shadow, sizing = "md", @@ -82,7 +84,11 @@ export const TextInput = forwardRef( )} {RightIcon && ( -
+
)} diff --git a/packages/ui/src/components/TextInput/theme.ts b/packages/ui/src/components/TextInput/theme.ts index 15b9f7003..aa5c41100 100644 --- a/packages/ui/src/components/TextInput/theme.ts +++ b/packages/ui/src/components/TextInput/theme.ts @@ -12,7 +12,7 @@ export const textInputTheme: FlowbiteTextInputTheme = createTheme({ svg: "h-5 w-5 text-gray-500 dark:text-gray-400", }, rightIcon: { - base: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3", + base: "absolute inset-y-0 right-0 flex items-center pr-3", svg: "h-5 w-5 text-gray-500 dark:text-gray-400", }, input: {