Skip to content

Redesign the position object returned by scrollBehavior #176

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

Merged
merged 3 commits into from
Jul 18, 2020

Conversation

posva
Copy link
Member

@posva posva commented May 31, 2020

@posva posva added breaking change This RFC contains breaking changes or deprecations of old API. router labels May 31, 2020
@posva posva force-pushed the router/scroll-position branch from f2ab0ec to b108642 Compare May 31, 2020 14:31
@JosephSilber
Copy link

How does this handle RTL-scrolling elements, where the x offset is a right offset instead of a left offset?

@posva
Copy link
Member Author

posva commented May 31, 2020

@JosephSilber since it's using scrollTo under the hood, it will handle it the same way. AFAIK it's still left. (This behavior doesn't change compared to previous versions, x was being used as left)

@atinux
Copy link

atinux commented Jun 1, 2020

Looking really good! Is the scrollBehavior called after the transition? Because using querySelector may return null if the transition is not done right? 🧐

@posva
Copy link
Member Author

posva commented Jun 1, 2020

Looking really good! Is the scrollBehavior called after the transition? Because using querySelector may return null if the transition is not done right? 🧐

Like with v3, you need to wait for the transition to be finished inside of scrollBehavior. I didn't mention it but it still supports a Promise, like in v3

posva added a commit to vuejs/router that referenced this pull request Jun 12, 2020
BREAKING CHANGE: this change follows the RFC at
vuejs/rfcs#176:
- `selector` is renamed into `el`
- `el` also accepts an `Element`
- `left` and `top` are passed along `el` instead of inside an object
  passed as `offset`
@posva
Copy link
Member Author

posva commented Jun 30, 2020

This RFC is now in final comments stage. An RFC in final comments stage means that:

The core team has reviewed the feedback and reached consensus about the general direction of the RFC and believes that this RFC is a worthwhile addition to the framework.
Final comments stage does not mean the RFC's design details are final - we may still tweak the details as we implement it and discover new technical insights or constraints. It may even be further adjusted based on user feedback after it lands in an alpha/beta release.
If no major objections with solid supporting arguments have been presented after a week, the RFC will be merged and become an active RFC.

@posva posva added the final comments This RFC is in final comments period label Jun 30, 2020
@posva posva force-pushed the router/scroll-position branch from 3ffd047 to 6f8289c Compare July 18, 2020 14:47
@posva posva merged commit 932e072 into vuejs:master Jul 18, 2020
@posva posva deleted the router/scroll-position branch July 18, 2020 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This RFC contains breaking changes or deprecations of old API. final comments This RFC is in final comments period router
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants