fix: editor scrolling not working

This commit is contained in:
Daniel Lautzenheiser 2023-01-22 00:48:16 -05:00
parent 6d9478f8f7
commit c1860c072d
No known key found for this signature in database
GPG Key ID: D2F75F7DD915527E
4 changed files with 2 additions and 10 deletions

View File

@ -666,7 +666,6 @@ export function loadEntries(collection: Collection, page = 0) {
const backend = currentBackend(configState.config); const backend = currentBackend(configState.config);
console.log('Trying to load page', page);
const loadAllEntries = 'nested' in collection || hasI18n(collection); const loadAllEntries = 'nested' in collection || hasI18n(collection);
const append = !!(page && !isNaN(page) && page > 0) && !loadAllEntries; const append = !!(page && !isNaN(page) && page > 0) && !loadAllEntries;
dispatch(entriesLoading(collection)); dispatch(entriesLoading(collection));

View File

@ -92,8 +92,6 @@ const Editor = ({
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [collection, createBackup, slug]); }, [collection, createBackup, slug]);
console.log('VERSION', version);
const [submitted, setSubmitted] = useState(false); const [submitted, setSubmitted] = useState(false);
const handlePersistEntry = useCallback( const handlePersistEntry = useCallback(
(opts: EditorPersistOptions = {}) => { (opts: EditorPersistOptions = {}) => {

View File

@ -55,17 +55,16 @@ const Editor = styled('div')`
interface PreviewPaneContainerProps { interface PreviewPaneContainerProps {
$blockEntry?: boolean; $blockEntry?: boolean;
$overFlow?: boolean;
} }
const PreviewPaneContainer = styled( const PreviewPaneContainer = styled(
'div', 'div',
transientOptions, transientOptions,
)<PreviewPaneContainerProps>( )<PreviewPaneContainerProps>(
({ $blockEntry, $overFlow }) => ` ({ $blockEntry }) => `
height: 100%; height: 100%;
pointer-events: ${$blockEntry ? 'none' : 'auto'}; pointer-events: ${$blockEntry ? 'none' : 'auto'};
overflow-y: ${$overFlow ? 'auto' : 'hidden'}; overflow-y: auto;
`, `,
); );

View File

@ -162,14 +162,10 @@ function entryDraftReducer(
entry: set(newState.entry, `${dataPath.join('.')}.${path}`, value), entry: set(newState.entry, `${dataPath.join('.')}.${path}`, value),
}; };
console.log('BEFORE I18N', { ...newState.entry });
if (i18n) { if (i18n) {
newState = duplicateI18nFields(newState, field, i18n.locales, i18n.defaultLocale); newState = duplicateI18nFields(newState, field, i18n.locales, i18n.defaultLocale);
} }
console.log('AFTER I18N', { ...newState.entry });
const newData = get(newState.entry, dataPath) ?? {}; const newData = get(newState.entry, dataPath) ?? {};
return { return {