Skip to content

Commit

Permalink
Allow scrolling in view mode
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Dec 1, 2022
1 parent d5dcbc7 commit a8683bd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 30 deletions.
2 changes: 2 additions & 0 deletions packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ function Iframe(
assets,
scale = 1,
frameSize = 0,
readonly,
...props
},
ref
Expand Down Expand Up @@ -355,6 +356,7 @@ function Iframe(
marginTop: frameSize,
transform: `scale( ${ scale } )`,
} }
inert={ readonly ? 'true' : undefined }
>
{ contentResizeListener }
{ /*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ function ResizableEditor( { enableResizing, settings, children, ...props } ) {
ref={ ref }
name="editor-canvas"
className="edit-site-visual-editor__editor-canvas"
readonly={ canvasMode === 'view' }
{ ...props }
>
{ /* Filters need to be rendered before children to avoid Safari rendering issues. */ }
Expand Down
43 changes: 17 additions & 26 deletions packages/edit-site/src/components/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,32 +191,23 @@ export default function Editor() {
content={
<>
<GlobalStylesRenderer />

<div
className="edit-site-editor__container"
inert={
isViewMode ? 'true' : undefined
}
>
<EditorNotices />
{ showVisualEditor &&
editedPost && <BlockEditor /> }
{ editorMode === 'text' &&
editedPost && <CodeEditor /> }
{ hasLoadedPost && ! editedPost && (
<Notice
status="warning"
isDismissible={ false }
>
{ __(
"You attempted to edit an item that doesn't exist. Perhaps it was deleted?"
) }
</Notice>
) }
{ isEditMode && (
<KeyboardShortcuts />
) }
</div>
<EditorNotices />
{ showVisualEditor && editedPost && (
<BlockEditor />
) }
{ editorMode === 'text' &&
editedPost && <CodeEditor /> }
{ hasLoadedPost && ! editedPost && (
<Notice
status="warning"
isDismissible={ false }
>
{ __(
"You attempted to edit an item that doesn't exist. Perhaps it was deleted?"
) }
</Notice>
) }
{ isEditMode && <KeyboardShortcuts /> }
</>
}
secondarySidebar={
Expand Down
4 changes: 0 additions & 4 deletions packages/edit-site/src/components/editor/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.edit-site-editor__container {
height: 100%;
}

.edit-site-editor__toggle-save-panel {
box-sizing: border-box;
width: $sidebar-width;
Expand Down

0 comments on commit a8683bd

Please sign in to comment.