vuejs / rfcs

RFCs for substantial changes / feature additions to Vue core
4.87k stars 546 forks source link

Redesign the position object returned by `scrollBehavior` #176

Closed posva closed 4 years ago

posva commented 4 years ago

Rendered

JosephSilber commented 4 years ago

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

posva commented 4 years ago

@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 commented 4 years ago

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

posva commented 4 years ago

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 commented 4 years ago

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.