tenants2
tenants2 copied to clipboard
Streamline how scrolling to top of page transitions are determined
In #1369 I implemented a whitelist to help the app figure out whether it needed to smoothly scroll to the top of the page or just jump straight to it. Ideally we should not need to use a whitelist, and should instead be able to dynamically tell whether the page being transitioned to is using some kind of gentle animation (such as a slide or fade), in which case we should use the gentle scroll animation.
Note that #1412 is one experiment to try to solve this issue.
Another potential solution, which I saw in a presentation or blog post about accessible React development a long time ago, is to actually embed the scrolling information in the link to a page, which gives every link control over what scrolling behavior it prefers. This information would not actually be captured in the URL, but via the to.state
prop of a react router's <Link>
component. Unfortunately I can no longer find the presentation/blog post I originally read this proposal in, but it seemed like an interesting solution.