Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const Input = forwardRef<InputRef, InputProps>((props, ref) => {
styles,
onCompositionStart,
onCompositionEnd,
onClear,
...rest
} = props;

Expand Down Expand Up @@ -173,6 +174,7 @@ const Input = forwardRef<InputRef, InputProps>((props, ref) => {
const handleReset = (e: React.MouseEvent<HTMLElement, MouseEvent>) => {
setValue('');
focus();
onClear?.();
Comment thread
li-jia-nan marked this conversation as resolved.
Outdated
if (inputRef.current) {
resolveOnChange(inputRef.current, e, onChange);
}
Expand Down
1 change: 1 addition & 0 deletions src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export interface InputProps
count?: CSSProperties;
};
count?: CountConfig;
onClear?: () => void;
}

export interface InputRef {
Expand Down