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

Commit

Permalink
fix: enable scrolling for i18n split view
Browse files Browse the repository at this point in the history
  • Loading branch information
KaneFreeman committed Dec 11, 2023
1 parent ff3edd0 commit ad943de
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
hidden;

&.CMS_Editor_i18n-active {
@apply flex;
@apply flex
overflow-y-auto
h-main;
}
}

Expand Down
46 changes: 24 additions & 22 deletions packages/core/src/components/entry-editor/EditorInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -355,28 +355,30 @@ const EditorInterface: FC<EditorInterfaceProps> = ({
locales
?.filter(locale => isSmallScreen || locale !== default_locale)
.map(locale => (
<div
key={locale}
className={classNames(
classes.i18n,
selectedLocale === locale && classes['i18n-active'],
)}
>
<EditorControlPane
collection={collection}
entry={entry}
fields={fields}
fieldsErrors={fieldsErrors}
locale={locale}
onLocaleChange={handleLocaleChange}
allowDefaultLocale={isSmallScreen}
submitted={submitted}
canChangeLocale
context={!isSmallScreen ? 'i18nSplit' : undefined}
hideBorder
disabled={editorDisabled}
/>
</div>
<ScrollSyncPane key={locale}>
<div
className={classNames(
classes.i18n,
selectedLocale === locale && classes['i18n-active'],
'CMS_Scrollbar_root',
)}
>
<EditorControlPane
collection={collection}
entry={entry}
fields={fields}
fieldsErrors={fieldsErrors}
locale={locale}
onLocaleChange={handleLocaleChange}
allowDefaultLocale={isSmallScreen}
submitted={submitted}
canChangeLocale
context={!isSmallScreen ? 'i18nSplit' : undefined}
hideBorder
disabled={editorDisabled}
/>
</div>
</ScrollSyncPane>
)),
[
locales,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/components/entry-editor/EditorToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ const EditorToolbar: FC<EditorToolbarProps> = ({
</MenuItemButton>
<MenuItemButton
onClick={toggleScrollSync}
disabled={isLoading || i18nActive || !previewActive}
disabled={isLoading || (!i18nActive && !previewActive)}
startIcon={HeightIcon}
endIcon={
scrollSyncActive && !(i18nActive || !previewActive) ? CheckIcon : undefined
scrollSyncActive && (i18nActive || previewActive) ? CheckIcon : undefined
}
>
{t('editor.editorInterface.toggleScrollSync')}
Expand Down

0 comments on commit ad943de

Please sign in to comment.