From feeeea666aa7b06a0a83fcf0882c8041fc5483f3 Mon Sep 17 00:00:00 2001 From: ashu8912 Date: Mon, 24 Jun 2024 16:13:48 +0530 Subject: [PATCH] frontend: Allow editor to auto-resize in case of text size change Signed-off-by: ashu8912 --- frontend/src/components/common/Resource/EditorDialog.tsx | 1 + frontend/src/components/common/Resource/Resource.tsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/common/Resource/EditorDialog.tsx b/frontend/src/components/common/Resource/EditorDialog.tsx index bedffd5b05..6e29ae0e74 100644 --- a/frontend/src/components/common/Resource/EditorDialog.tsx +++ b/frontend/src/components/common/Resource/EditorDialog.tsx @@ -70,6 +70,7 @@ export default function EditorDialog(props: EditorDialogProps) { const editorOptions = { selectOnLineNumbers: true, readOnly: isReadOnly(), + automaticLayout: true, }; const { i18n } = useTranslation(); const [lang, setLang] = React.useState(i18n.language); diff --git a/frontend/src/components/common/Resource/Resource.tsx b/frontend/src/components/common/Resource/Resource.tsx index 5de57215a3..7ebd9f42d6 100644 --- a/frontend/src/components/common/Resource/Resource.tsx +++ b/frontend/src/components/common/Resource/Resource.tsx @@ -425,7 +425,7 @@ export function DataField(props: DataFieldProps) { value={value as string} language={language} onMount={handleEditorDidMount} - options={{ readOnly: true, lineNumbers: 'off' }} + options={{ readOnly: true, lineNumbers: 'off', automaticLayout: true }} theme={themeName === 'dark' ? 'vs-dark' : 'light'} /> @@ -446,7 +446,7 @@ export function DataField(props: DataFieldProps) { value={value as string} language={language} onMount={handleEditorDidMount} - options={{ readOnly: true, lineNumbers: 'off' }} + options={{ readOnly: true, lineNumbers: 'off', automaticLayout: true }} theme={themeName === 'dark' ? 'vs-dark' : 'light'} />