Skip to content

Sticky Scrolling Makes Scrolling Stutter #191973

@hediet

Description

@hediet

Scrolling through a file with sticky scrolling enabled:

Image

without:

Image

It looks like there are more dropped frames when sticky scrolling is enabled.

A rendering frame looks like this with sticky scrolling disabled:

Image

And like this with sticky scrolling enabled:

Image

(u seems to be StickyScrollWidget._renderRootNode)

I think the slow Recalculate Style comes from reading the layout in line 339:

private _updateMinContentWidth() {
this._minContentWidthInPx = 0;
for (const stickyLine of this._stickyLines) {
if (stickyLine.lineDomNode.scrollWidth > this._minContentWidthInPx) {
this._minContentWidthInPx = stickyLine.lineDomNode.scrollWidth;
}
}
this._minContentWidthInPx += this._editor.getLayoutInfo().verticalScrollbarWidth;
}

Can you cache this somehow? I don't know why reading this property causes this additional layout (because I thought the browser would do this layout anyway). Maybe Alex can also help here.

Metadata

Metadata

Labels

debtCode quality issueseditor-sticky-scrollpapercut 🩸A particularly annoying issue impacting someone on the teampolishCleanup and polish issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions