prevent the page from flickering when opening multiple slideouts #18263
+4
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The slideout view transitions were struggling a bit in some browsers when opening multiple slideouts from one another.
While FF and Safari handled them just fine, Chrome started to struggle around opening slideout 6 in a row (earlier with some other browsers). The content would flicker, and in some cases, once the slideout was open, not all the content was visible. In such a case, simply scrolling up or down would fix the rendered view.
This would only happen if you don’t have reduced motion preference enabled and if the browser window is large enough for the slideouts to slide in from the sides (not the bottom).
The transitions we use to animate the slideout into place involve changing the left/right position as well as changing the opacity of the shade. We already use the
will-changeCSS property to improve the performance of the slideout open/close animation, but we only mentioned theinset-inline-startandinset-inline-endvalues.Adding
opacityto that list makes the transition run smoothly in Chrome, but it doesn’t improve behaviour in Brave, Ecosia, or Arc. Interestingly, some browsers, like FF and Safari, run the transitions as expected even withoutwill-change. I tested a few combinations, and the option that works best across all browsers that I tested with (FF, Safari, Chrome, Brave, Ecosia, Arc) iswill-change: transition;.Related issues
#18255