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

component.Base: vdom => add a scroll attribute #6468

Open
tobiu opened this issue Feb 19, 2025 · 0 comments
Open

component.Base: vdom => add a scroll attribute #6468

tobiu opened this issue Feb 19, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@tobiu
Copy link
Collaborator

tobiu commented Feb 19, 2025

While it is not possible to set the scroll position on DOM level, this would not be a problem for neo: a delta would contain a changed scrollLeft or scrollTop value, and could easily programmatically adjust the scroll state once the node is painted or updated.

E.g.:

{tag: 'div', scroll: {top: '100px'}}
  • For getting deltas including scroll changes, Neo.vdom.Vnode also needs to get the new scroll attribute.
  • It is important for this scenario, that user based scroll changes also update the related vdom & vnode attributes for the matching component, otherwise we could get deltas when there is no need for a change.

Rationale where I would use it:

Screen.Recording.2025-02-19.at.11.59.48.mov

I know it is minor, but if you look close, you can see that the scrolling (sometimes painting new rows outside the buffer range on the fly) and the selection change do not always happen inside the same animation frame.

The view triggers an update, passing vdom&vnode to the vdom worker, it figures out the deltas and applies them inside main (cycling rows). in parallel the app worker directly sends a request to main to adjust the scroll position.

@tobiu tobiu added the enhancement New feature or request label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant