Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Commit ad943de

Browse files
committed
fix: enable scrolling for i18n split view
1 parent ff3edd0 commit ad943de

File tree

3 files changed

+29
-25
lines changed

3 files changed

+29
-25
lines changed

packages/core/src/components/entry-editor/EditorInterface.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
hidden;
3333

3434
&.CMS_Editor_i18n-active {
35-
@apply flex;
35+
@apply flex
36+
overflow-y-auto
37+
h-main;
3638
}
3739
}
3840

packages/core/src/components/entry-editor/EditorInterface.tsx

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -355,28 +355,30 @@ const EditorInterface: FC<EditorInterfaceProps> = ({
355355
locales
356356
?.filter(locale => isSmallScreen || locale !== default_locale)
357357
.map(locale => (
358-
<div
359-
key={locale}
360-
className={classNames(
361-
classes.i18n,
362-
selectedLocale === locale && classes['i18n-active'],
363-
)}
364-
>
365-
<EditorControlPane
366-
collection={collection}
367-
entry={entry}
368-
fields={fields}
369-
fieldsErrors={fieldsErrors}
370-
locale={locale}
371-
onLocaleChange={handleLocaleChange}
372-
allowDefaultLocale={isSmallScreen}
373-
submitted={submitted}
374-
canChangeLocale
375-
context={!isSmallScreen ? 'i18nSplit' : undefined}
376-
hideBorder
377-
disabled={editorDisabled}
378-
/>
379-
</div>
358+
<ScrollSyncPane key={locale}>
359+
<div
360+
className={classNames(
361+
classes.i18n,
362+
selectedLocale === locale && classes['i18n-active'],
363+
'CMS_Scrollbar_root',
364+
)}
365+
>
366+
<EditorControlPane
367+
collection={collection}
368+
entry={entry}
369+
fields={fields}
370+
fieldsErrors={fieldsErrors}
371+
locale={locale}
372+
onLocaleChange={handleLocaleChange}
373+
allowDefaultLocale={isSmallScreen}
374+
submitted={submitted}
375+
canChangeLocale
376+
context={!isSmallScreen ? 'i18nSplit' : undefined}
377+
hideBorder
378+
disabled={editorDisabled}
379+
/>
380+
</div>
381+
</ScrollSyncPane>
380382
)),
381383
[
382384
locales,

packages/core/src/components/entry-editor/EditorToolbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,10 @@ const EditorToolbar: FC<EditorToolbarProps> = ({
360360
</MenuItemButton>
361361
<MenuItemButton
362362
onClick={toggleScrollSync}
363-
disabled={isLoading || i18nActive || !previewActive}
363+
disabled={isLoading || (!i18nActive && !previewActive)}
364364
startIcon={HeightIcon}
365365
endIcon={
366-
scrollSyncActive && !(i18nActive || !previewActive) ? CheckIcon : undefined
366+
scrollSyncActive && (i18nActive || previewActive) ? CheckIcon : undefined
367367
}
368368
>
369369
{t('editor.editorInterface.toggleScrollSync')}

0 commit comments

Comments
 (0)