Skip to content

Commit

Permalink
Iframe: restore typewriter effect in post editor (#46745)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix authored Dec 22, 2022
1 parent c365a80 commit beb80db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/block-editor/src/components/typewriter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ export function useTypewriter() {
return;
}

const windowScroll = scrollContainer === ownerDocument.body;
const windowScroll =
scrollContainer === ownerDocument.body ||
scrollContainer === ownerDocument.documentElement;
const scrollY = windowScroll
? defaultView.scrollY
: scrollContainer.scrollTop;
Expand Down
7 changes: 5 additions & 2 deletions packages/edit-post/src/components/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,11 @@ export default function VisualEditor( { styles } ) {
...styles,
{
// We should move this in to future to the body.
css: `.edit-post-visual-editor__post-title-wrapper{margin-top:4rem}`,
css:
`.edit-post-visual-editor__post-title-wrapper{margin-top:4rem}` +
( paddingBottom
? `body{padding-bottom:${ paddingBottom }}`
: '' ),
},
],
[ styles ]
Expand Down Expand Up @@ -358,7 +362,6 @@ export default function VisualEditor( { styles } ) {
contentRef={ contentRef }
styles={ styles }
assets={ assets }
style={ { paddingBottom } }
>
{ themeSupportsLayout &&
! themeHasDisabledLayoutStyles &&
Expand Down

1 comment on commit beb80db

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3760104864
📝 Reported issues:

Please sign in to comment.