Skip to content

Commit

Permalink
Merge pull request #2082 from headlamp-k8s/auto-resize-on-text-size-c…
Browse files Browse the repository at this point in the history
…hange

frontend: Allow editor to auto-resize in case of text size change
  • Loading branch information
illume authored Jul 1, 2024
2 parents e8080ab + feeeea6 commit 408b62a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/src/components/common/Resource/EditorDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/common/Resource/Resource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
/>
</Box>
Expand All @@ -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'}
/>
</Box>
Expand Down

0 comments on commit 408b62a

Please sign in to comment.