Skip to content

Commit a2e3604

Browse files
web-padawanclaude
andauthored
fix: prevent detail flash on close with fill forwards and rAF cancel (#11419)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 25f58e4 commit a2e3604

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/master-detail-layout/src/vaadin-master-detail-layout.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ class MasterDetailLayout extends ElementMixin(ThemableMixin(PolylitMixin(LitElem
650650
* @private
651651
*/
652652
__animate(element, keyframes, options) {
653-
const animation = element.animate(keyframes, options);
653+
const animation = element.animate(keyframes, { ...options, fill: 'forwards' });
654654

655655
this.__activeAnimations = this.__activeAnimations || [];
656656
this.__activeAnimations.push(animation);
@@ -670,6 +670,10 @@ class MasterDetailLayout extends ElementMixin(ThemableMixin(PolylitMixin(LitElem
670670
}
671671
this.removeAttribute('transition');
672672
this.__clearOutgoing();
673+
// Cancel any pending ResizeObserver rAF that captured stale state
674+
// during the animation — _finishTransition already applied the
675+
// correct post-transition state synchronously.
676+
cancelAnimationFrame(this.__resizeRaf);
673677
if (this.__transitionResolve) {
674678
this.__transitionResolve();
675679
this.__transitionResolve = null;

0 commit comments

Comments
 (0)