We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94170ba commit 8eb411cCopy full SHA for 8eb411c
packages/components/src/components/Input/index.tsx
@@ -21,6 +21,7 @@ interface InputProps extends Omit<ComponentProps<'input'>, 'type'> {
21
icon?: string
22
errorMessage?: string
23
}
24
+ onClear?: () => void
25
colors?: {
26
primary?: string
27
error?: string
@@ -49,6 +50,7 @@ export function Input({
49
50
className,
51
classNames,
52
ref,
53
+ onClear,
54
...props
55
}: InputProps) {
56
const [value, setValue] = useState(defaultValue || '')
@@ -58,6 +60,7 @@ export function Input({
58
60
59
61
const handleClear = () => {
62
setValue('')
63
+ onClear?.()
64
65
const clearButtonVisible = value && !disabled && allowClear
66
0 commit comments