feat(Virtual): add skipInitialWrap to defer wrap behavior until first navigation#25
Open
luccalaz wants to merge 1 commit into
Open
feat(Virtual): add skipInitialWrap to defer wrap behavior until first navigation#25luccalaz wants to merge 1 commit into
luccalaz wants to merge 1 commit into
Conversation
… advance When combined with `wrap`, suppresses the initial left buffer offset and makes left press a no-op until the user first navigates forward. Useful for swimlanes where the row should look like a non-wrapping list until the user has actually moved through it. Ignored when the component mounts with a non-zero `selected`.
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.
Summary
Adds
skipInitialWraptoVirtualRow/VirtualColumn. When combined withwrap, it defers wrap behaviour until the user first navigates forward — useful for swimlanes that should look like a normal non-wrapping row on mount and only become a wrap row once the user has actually moved through them.The first right press unlocks wrap for the rest of the component's lifetime. The prop is ignored when the component mounts with a non-zero
selected.Why
In TV UIs it's common to want a row that doesn't reveal its wrap character until the user engages with it. Without this prop, enabling
wrapforces an immediate left-buffer offset on mount, which looks visually wrong for a "first time on the page" state and makes a left press from index 0 jump straight to the last item before the user has done anything.Implementation notes
effectiveWrap()memo gates all wrap-dependent branches, so wrap behaviour can be toggled dynamically when the user advances.selected()function branches on a constant captured at setup, not the live unlock signal. This prevents the render effect from overwriting focus position updates during navigation.doOnce = initiallyLocked) because the first right press naturally produces the correct offset (no extra adjustment needed).