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

Move commandsto JumpToLocation #24

Open
chocolatkey opened this issue Nov 1, 2022 · 0 comments
Open

Move commandsto JumpToLocation #24

chocolatkey opened this issue Nov 1, 2022 · 0 comments

Comments

@chocolatkey
Copy link
Member

Some of the go commands should be in the JumpToLocation module, such as go_text and go_id. Snapper's job is only to scroll+snap the content when requested.

This implies that some modules like JumpToLocation might depend on APIs provided by the Snapper. Maybe we can use commands/events for this instead of direct access.

It could flow like this:

  1. The app calls a go_x command in the JumpToLocation module.
  2. The command computes a target DOMRect, then requests the Snapper to snap_to the target rect (with a command event, or direct function call).
  3. The Snapper will resolve the target rect to an actual offset, depending on the technique used for the positioning (CSS translation, native scroll, etc.) and the layout nature (paginated, scrolled, RTL, etc.).
  4. The Snapper will move the viewport to the target offset, with an animation if requested.

Originally posted by @mickael-menu in #12 (comment)

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

No branches or pull requests

1 participant