Fix scrollbar position for no-preview editor
This commit is contained in:
parent
213b2336b6
commit
3112acff9b
@ -2,13 +2,13 @@ import SelectUnstyled from '@mui/base/SelectUnstyled';
|
|||||||
import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@styled-icons/material/KeyboardArrowDown';
|
import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@styled-icons/material/KeyboardArrowDown';
|
||||||
import React, { forwardRef, useCallback, useState } from 'react';
|
import React, { forwardRef, useCallback, useState } from 'react';
|
||||||
|
|
||||||
|
import useDebounce from '@staticcms/core/lib/hooks/useDebounce';
|
||||||
import useElementSize from '@staticcms/core/lib/hooks/useElementSize';
|
import useElementSize from '@staticcms/core/lib/hooks/useElementSize';
|
||||||
import classNames from '@staticcms/core/lib/util/classNames.util';
|
import classNames from '@staticcms/core/lib/util/classNames.util';
|
||||||
import { isNotEmpty } from '@staticcms/core/lib/util/string.util';
|
import { isNotEmpty } from '@staticcms/core/lib/util/string.util';
|
||||||
import Option from './Option';
|
import Option from './Option';
|
||||||
|
|
||||||
import type { FocusEvent, KeyboardEvent, MouseEvent, ReactNode, Ref } from 'react';
|
import type { FocusEvent, KeyboardEvent, MouseEvent, ReactNode, Ref } from 'react';
|
||||||
import useDebounce from '@staticcms/core/lib/hooks/useDebounce';
|
|
||||||
|
|
||||||
export interface Option {
|
export interface Option {
|
||||||
label: string;
|
label: string;
|
||||||
|
@ -3,6 +3,7 @@ import { ScrollSyncPane } from 'react-scroll-sync';
|
|||||||
|
|
||||||
import useBreadcrumbs from '@staticcms/core/lib/hooks/useBreadcrumbs';
|
import useBreadcrumbs from '@staticcms/core/lib/hooks/useBreadcrumbs';
|
||||||
import { getI18nInfo, getPreviewEntry, hasI18n } from '@staticcms/core/lib/i18n';
|
import { getI18nInfo, getPreviewEntry, hasI18n } from '@staticcms/core/lib/i18n';
|
||||||
|
import classNames from '@staticcms/core/lib/util/classNames.util';
|
||||||
import {
|
import {
|
||||||
getFileFromSlug,
|
getFileFromSlug,
|
||||||
selectEntryCollectionTitle,
|
selectEntryCollectionTitle,
|
||||||
@ -47,7 +48,7 @@ const EditorContent = ({
|
|||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<div className="w-editor-only max-w-full h-main">{editor}</div>
|
<div className="w-editor-only max-w-full">{editor}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -166,12 +167,17 @@ const EditorInterface = ({
|
|||||||
<div
|
<div
|
||||||
key={defaultLocale}
|
key={defaultLocale}
|
||||||
id="control-pane"
|
id="control-pane"
|
||||||
className="
|
className={classNames(
|
||||||
w-full
|
`
|
||||||
overflow-y-auto
|
w-full
|
||||||
styled-scrollbars
|
`,
|
||||||
h-main
|
(finalPreviewActive || i18nActive) &&
|
||||||
"
|
`
|
||||||
|
overflow-y-auto
|
||||||
|
styled-scrollbars
|
||||||
|
h-main
|
||||||
|
`,
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<EditorControlPane
|
<EditorControlPane
|
||||||
collection={collection}
|
collection={collection}
|
||||||
@ -251,7 +257,7 @@ const EditorInterface = ({
|
|||||||
<MainView
|
<MainView
|
||||||
breadcrumbs={breadcrumbs}
|
breadcrumbs={breadcrumbs}
|
||||||
noMargin
|
noMargin
|
||||||
noScroll
|
noScroll={finalPreviewActive || i18nActive}
|
||||||
navbarActions={
|
navbarActions={
|
||||||
<EditorToolbar
|
<EditorToolbar
|
||||||
isPersisting={entry.isPersisting}
|
isPersisting={entry.isPersisting}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user