Skip to content

Conversation

scdekov
Copy link

@scdekov scdekov commented Sep 24, 2025

This PR adds opt-in support for variable-height rows when virtual is enabled. It measures rendered rows, maintains cumulative offsets, and uses binary search to map scrollTop to item indices, ensuring smooth, accurate scrolling even when content wraps or custom renders change row height.

The main motivation is to allow showing longer json string values wrapped so that they're more readable compared to having a long horizontal scroll when using virtual scrolling.

closes: #286

@leezng leezng self-requested a review September 26, 2025 02:10
@leezng
Copy link
Owner

leezng commented Sep 30, 2025

@scdekov Thank you so much! This is a great feature.

However, I've noticed a problem with this commit: component rendering becomes sluggish when the browser viewport width changes, such as by dragging and resizing the browser. Could you help fix this?

The latest version doesn't have this lag; see https://leezng.github.io/vue-json-pretty/

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

Successfully merging this pull request may close these issues.

Virtual scrolling jumps around for large text items
2 participants