Skip to content
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

Line Numbers: Improved resize performance #2125

Merged

Conversation

RunDevelopment
Copy link
Member

This significantly improves the code which resizes an element by batching all DOM reads/writes.

This resolves #2123.

@RunDevelopment RunDevelopment merged commit b96ed22 into PrismJS:master Jun 28, 2020
@RunDevelopment RunDevelopment deleted the line-numbers-resize-perf branch June 28, 2020 13:40
quentinvernot pushed a commit to TankerHQ/prismjs that referenced this pull request Sep 11, 2020
@bkdotcom
Copy link

speaking of the window resize listener...
see #2192

Prism.manual = true;
in 1.22 it tries to "refresh line numbers" of all $$('pre[data-line]') regardless of whether Prism.highlightElement() has been called yet... which leads to "Uncaught TypeError: Cannot read property 'children' of null"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Line Numbers resize event going crazy when scrolling on mobile, freezing screen for more than a second
3 participants