Skip to content

Commit

Permalink
Do not allow scrollTopNext to be smaller than 0
Browse files Browse the repository at this point in the history
  • Loading branch information
jeryj committed Nov 11, 2024
1 parent ab31e44 commit 0b4d86d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,10 @@ function Iframe( {
// possible scrollTop positions. Round the value to avoid subpixel
// truncation by the browser which sometimes causes a 1px error.
scrollTopNext = Math.round(
Math.min( Math.max( 0, scrollTopNext ), maxScrollTop )
Math.min(
Math.max( 0, scrollTopNext ),
Math.max( 0, maxScrollTop )
)
);

iframeDocument.documentElement.style.setProperty(
Expand Down

0 comments on commit 0b4d86d

Please sign in to comment.