diff --git a/packages/ketcher-react/src/script/ui/component/form/input.jsx b/packages/ketcher-react/src/script/ui/component/form/input.jsx index d37578d610..a95095a8b3 100644 --- a/packages/ketcher-react/src/script/ui/component/form/input.jsx +++ b/packages/ketcher-react/src/script/ui/component/form/input.jsx @@ -14,19 +14,28 @@ * limitations under the License. ***************************************************************************/ -import { Component } from 'react' +import { Component, createRef } from 'react' import { omit } from 'lodash/fp' import classes from './input.module.less' import clsx from 'clsx' +const inputRef = createRef() // works with errors + export function GenericInput({ schema, value = '', onChange, type = 'text', + inFocus = false, ...props }) { + function isInputFocused(isFocus, ref) { + if (!ref.current || !isFocus) return false + ref.current.focus() + return true + } + return ( <> {type === 'checkbox' && } @@ -95,8 +107,7 @@ function Select({ value={value} name={name} multiple={multiple} - className={clsx(classes.select, className)} - > + className={clsx(classes.select, className)}> {enumSchema(schema, (title, val) => (