From 230d17da35058975a0362da5f11b16359ea24dee Mon Sep 17 00:00:00 2001 From: IRBorisov <8611739+IRBorisov@users.noreply.github.com> Date: Thu, 9 May 2024 12:47:59 +0300 Subject: [PATCH] Fix editor height to improve scroll experience --- .../frontend/src/components/RSInput/RSInput.tsx | 11 ++++++++++- .../frontend/src/components/RefsInput/RefsInput.tsx | 13 ++++++++++++- .../EditorConstituenta/FormConstituenta.tsx | 6 ++++-- .../EditorRSExpression/EditorRSExpression.tsx | 3 ++- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/rsconcept/frontend/src/components/RSInput/RSInput.tsx b/rsconcept/frontend/src/components/RSInput/RSInput.tsx index 42912106..4df5af9b 100644 --- a/rsconcept/frontend/src/components/RSInput/RSInput.tsx +++ b/rsconcept/frontend/src/components/RSInput/RSInput.tsx @@ -23,7 +23,16 @@ import { rsHoverTooltip } from './tooltip'; interface RSInputProps extends Pick< ReactCodeMirrorProps, - 'id' | 'height' | 'minHeight' | 'maxHeight' | 'value' | 'onFocus' | 'onBlur' | 'placeholder' | 'style' | 'className' + | 'id' // prettier: split-lines + | 'height' + | 'minHeight' + | 'maxHeight' + | 'value' + | 'onFocus' + | 'onBlur' + | 'placeholder' + | 'style' + | 'className' > { label?: string; disabled?: boolean; diff --git a/rsconcept/frontend/src/components/RefsInput/RefsInput.tsx b/rsconcept/frontend/src/components/RefsInput/RefsInput.tsx index d22ae75a..e10b93dc 100644 --- a/rsconcept/frontend/src/components/RefsInput/RefsInput.tsx +++ b/rsconcept/frontend/src/components/RefsInput/RefsInput.tsx @@ -50,7 +50,18 @@ const editorSetup: BasicSetupOptions = { }; interface RefsInputInputProps - extends Pick { + extends Pick< + ReactCodeMirrorProps, + | 'id' // prettier: split-lines + | 'height' + | 'minHeight' + | 'maxHeight' + | 'value' + | 'className' + | 'onFocus' + | 'onBlur' + | 'placeholder' + > { label?: string; onChange?: (newValue: string) => void; schema?: IRSForm; diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/FormConstituenta.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/FormConstituenta.tsx index 954518bc..f83833a4 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/FormConstituenta.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/FormConstituenta.tsx @@ -145,6 +145,7 @@ function FormConstituenta({ key='cst_term' id='cst_term' label='Термин' + maxHeight='7.5rem' placeholder='Обозначение, используемое в текстовых определениях' schema={schema} value={term} @@ -197,7 +198,8 @@ function FormConstituenta({ id='cst_definition' label='Текстовое определение' placeholder='Текстовая интерпретация формального выражения' - height='3.8rem' + minHeight='3.75rem' + maxHeight='7.5rem' schema={schema} value={textDefinition} initialValue={state?.definition_raw ?? ''} @@ -210,7 +212,7 @@ function FormConstituenta({