From 6a8964844c6da6a0d2b516a2a869b0fd6e16eb9f Mon Sep 17 00:00:00 2001 From: Nikita_Vozisov Date: Thu, 27 Oct 2022 17:47:43 +0300 Subject: [PATCH] added autofocus attribute for texarea --- .../ui/views/modal/components/document/Open/Open.tsx | 1 + .../components/document/Open/components/TextEditor.tsx | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/ketcher-react/src/script/ui/views/modal/components/document/Open/Open.tsx b/packages/ketcher-react/src/script/ui/views/modal/components/document/Open/Open.tsx index c206a5e571..e3ff3fa4f1 100644 --- a/packages/ketcher-react/src/script/ui/views/modal/components/document/Open/Open.tsx +++ b/packages/ketcher-react/src/script/ui/views/modal/components/document/Open/Open.tsx @@ -158,6 +158,7 @@ const Open: FC = (props) => { isRecognizeDisabled={isRecognizeDisabled} structStr={structStr} inputHandler={setStructStr} + autoFocus /> ) diff --git a/packages/ketcher-react/src/script/ui/views/modal/components/document/Open/components/TextEditor.tsx b/packages/ketcher-react/src/script/ui/views/modal/components/document/Open/components/TextEditor.tsx index d671d706de..43ac9054fb 100644 --- a/packages/ketcher-react/src/script/ui/views/modal/components/document/Open/components/TextEditor.tsx +++ b/packages/ketcher-react/src/script/ui/views/modal/components/document/Open/components/TextEditor.tsx @@ -19,15 +19,21 @@ import classes from '../Open.module.less' export type TextEditorProps = { structStr: string inputHandler: (str: string) => void + autoFocus?: boolean } -export const TextEditor = ({ structStr, inputHandler }: TextEditorProps) => { +export const TextEditor = ({ + structStr, + inputHandler, + autoFocus = false +}: TextEditorProps) => { return ( <>