-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call revealLastElement within runAtThisOrScheduleAtNextAnimationFrame in repl #75043
Conversation
Thanks for providing the PR. Added comments in the code |
const treeHeight = dimension.height - this.replInputHeight; | ||
this.tree.getHTMLElement().style.height = `${treeHeight}px`; | ||
this.tree.layout(treeHeight, dimension.width); | ||
if (lastElementVisible) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not really like this call here.
When the repl gets layouted if the last element is visible we should reveal it?
Why should we reveal it if it is already visible?
Also on layout seems like a wrong place to call this. Layout happens every time the dimensions of the repl change and on the first render.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this approach is not good, bottom line it just calls reveal more often and with a timeout. Note the height strategy we use with the tree which the repl uses. Repl gives the provisional height of each element so the tree would get an idea of the scroll size, and once the elments are in the dom the tree measuers them actually and adjusts. Thanks again for jumping on this issue! |
Updated the PR with a better approximation for provisional height |
Great work, merging in. |
Fixes #70331