Fix template part focus mode resizable editor height#43408
Merged
Conversation
|
Size Change: +36 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
9de9b87 to
7bee808
Compare
Mamaduka
approved these changes
Aug 22, 2022
|
|
||
| setHeight( iframe.contentDocument.body.scrollHeight ); | ||
| timeoutId = null; | ||
| }, 40 ); |
Member
There was a problem hiding this comment.
Is 40 just an arbitrary delay here?
Contributor
Author
There was a problem hiding this comment.
It was 25 fps, but I've decided to change it to 30fps, which should be closer to requestAnimationFrame.
a853092 to
3101946
Compare
Member
|
Thanks for fixing this one, was really degrading the experience |
This was referenced Oct 21, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Fixes #42226
It seems like #38855 switching the iframe to standards mode changed a few aspects of how the iframe behaves:
requestAnimationFramedoesn't work. I could see it would get triggered but the callback never called. Possibly it doesn't work until the document is ready. The code that sets the height was within arequestAnimationFramefor throttling, so that was the first issue. I've switched tosetTimeoutiframe.contentDocument.documentElement.scrollHeightalways seems to be whatever the pixel value is for100%height in standards mode. I've switched toiframe.contentDocument.body.scrollHeight.iframe.contentDocument.bodyisn't defined and an error is thrown.Testing Instructions
Adds an e2e test(I did write an e2e test for this, but it was too unstable, I couldn't find a way to wait for the focus mode to finish loading and resizing, it's now removed)Expected: the editable area should be the height of the content
In trunk: the editable area is the height of the viewport
Screenshots or screencast
Before
Kapture.2022-08-19.at.16.27.18.mp4
After
Kapture.2022-08-19.at.16.25.57.mp4