fix(vscode-ide-companion/permission-drawer): improve ref typing for input element

This commit is contained in:
yiliang114
2025-12-08 11:31:50 +08:00
parent 63e4794633
commit efccd44cb4

View File

@@ -276,7 +276,7 @@ interface CustomMessageInputRowProps {
setCustomMessage: (val: string) => void; setCustomMessage: (val: string) => void;
onFocusRow: () => void; // Set focus when mouse enters or input box is focused onFocusRow: () => void; // Set focus when mouse enters or input box is focused
onSubmitReject: () => void; // Triggered when Enter is pressed (selecting reject option) onSubmitReject: () => void; // Triggered when Enter is pressed (selecting reject option)
inputRef: React.RefObject<HTMLInputElement>; inputRef: React.RefObject<HTMLInputElement | null>;
} }
const CustomMessageInputRow: React.FC<CustomMessageInputRowProps> = ({ const CustomMessageInputRow: React.FC<CustomMessageInputRowProps> = ({
@@ -295,7 +295,7 @@ const CustomMessageInputRow: React.FC<CustomMessageInputRowProps> = ({
onClick={() => inputRef.current?.focus()} onClick={() => inputRef.current?.focus()}
> >
<input <input
ref={inputRef} ref={inputRef as React.LegacyRef<HTMLInputElement> | undefined}
type="text" type="text"
placeholder="Tell Qwen what to do instead" placeholder="Tell Qwen what to do instead"
spellCheck={false} spellCheck={false}