Fix editor height to improve scroll experience

This commit is contained in:
IRBorisov 2024-05-09 12:47:59 +03:00
parent 320a1b1c96
commit 230d17da35
4 changed files with 28 additions and 5 deletions

View File

@ -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;

View File

@ -50,7 +50,18 @@ const editorSetup: BasicSetupOptions = {
};
interface RefsInputInputProps
extends Pick<ReactCodeMirrorProps, 'id' | 'height' | 'value' | 'className' | 'onFocus' | 'onBlur' | 'placeholder'> {
extends Pick<
ReactCodeMirrorProps,
| 'id' // prettier: split-lines
| 'height'
| 'minHeight'
| 'maxHeight'
| 'value'
| 'className'
| 'onFocus'
| 'onBlur'
| 'placeholder'
> {
label?: string;
onChange?: (newValue: string) => void;
schema?: IRSForm;

View File

@ -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({
<TextArea
id='cst_convention'
spellCheck
className='h-[3.8rem]'
className='h-[3.75rem]'
label={isBasic ? 'Конвенция' : 'Комментарий'}
placeholder={isBasic ? 'Договоренность об интерпретации' : 'Пояснение разработчика'}
value={convention}

View File

@ -211,7 +211,8 @@ function EditorRSExpression({
<RSInput
ref={rsInput}
value={value}
minHeight='3.8rem'
minHeight='3.75rem'
maxHeight='7.5rem'
disabled={disabled}
onChange={handleChange}
onAnalyze={handleCheckExpression}