(null);
const focus = (options?: FocusOptions) => {
inputRef.current?.focus({ preventScroll: true, ...options });
};
useImperativeHandle(ref, () => ({
focus,
blur: () => inputRef.current?.blur(),
input: inputRef.current,
container: containerRef.current,
}));
const showClear = clearable && !disabled && !!value;
const handleClear = () => {
onClear?.();
focus();
};
return (
{prefix && {prefix}}
{suffix && {suffix}}
{showClear && (
e.preventDefault()}
onClick={handleClear}
>
)}
);
});
Input.displayName = 'Input';
export default Input;