Skip to content

Commit 72dcdd5

Browse files
committed
feat: guard to imperative focus
1 parent 92bda6b commit 72dcdd5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/components/TextInput/hooks.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,11 @@ export const useTextInput = (props: TextInputProps): TextInputHookReturn => {
383383
}, [props.value]);
384384

385385
useImperativeHandle(ref, () => ({
386-
focus: () => input.current?.focus(),
386+
focus: () => {
387+
if (flags.isDisabled) return;
388+
389+
input.current?.focus();
390+
},
387391
clear: () => {
388392
input.current?.clear();
389393

0 commit comments

Comments
 (0)