Skip to content

Commit 5c1ffa7

Browse files
committed
conditionally add 'pointer-events-none' class on right icon
1 parent feeec40 commit 5c1ffa7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ export const TextInput = forwardRef<HTMLInputElement, TextInputProps>(
8484
</div>
8585
)}
8686
{RightIcon && (
87-
<div data-testid="right-icon" className={theme.field.rightIcon.base} onClick={onRightIconClick}>
87+
<div
88+
data-testid="right-icon"
89+
className={`${theme.field.rightIcon.base} ${!onRightIconClick ? "pointer-events-none" : ""}`}
90+
onClick={onRightIconClick}
91+
>
8892
<RightIcon className={theme.field.rightIcon.svg} />
8993
</div>
9094
)}

0 commit comments

Comments
 (0)