Skip to content

Commit d336c36

Browse files
authored
refactor: remove usage of Polymer helpers from app-layout (#9038)
1 parent d19504c commit d336c36

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

packages/app-layout/src/vaadin-app-layout-mixin.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
* Copyright (c) 2018 - 2025 Vaadin Ltd.
44
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
55
*/
6-
import { afterNextRender, beforeNextRender } from '@polymer/polymer/lib/utils/render-status.js';
76
import { AriaModalController } from '@vaadin/a11y-base/src/aria-modal-controller.js';
87
import { FocusTrapController } from '@vaadin/a11y-base/src/focus-trap-controller.js';
8+
import { animationFrame } from '@vaadin/component-base/src/async.js';
9+
import { Debouncer } from '@vaadin/component-base/src/debounce.js';
910
import { I18nMixin } from '@vaadin/component-base/src/i18n-mixin.js';
1011

1112
/**
@@ -144,7 +145,9 @@ export const AppLayoutMixin = (superclass) =>
144145
window.addEventListener('resize', this.__boundResizeListener);
145146
this.addEventListener('drawer-toggle-click', this.__drawerToggleClickListener);
146147

147-
beforeNextRender(this, this._afterFirstRender);
148+
requestAnimationFrame(() => {
149+
this._updateOffsetSize();
150+
});
148151

149152
this._updateTouchOptimizedMode();
150153
this._updateDrawerSize();
@@ -255,12 +258,6 @@ export const AppLayoutMixin = (superclass) =>
255258
this.__updateDrawerAriaAttributes();
256259
}
257260

258-
/** @protected */
259-
_afterFirstRender() {
260-
this._blockAnimationUntilAfterNextRender();
261-
this._updateOffsetSize();
262-
}
263-
264261
/** @private */
265262
_drawerToggleClick(e) {
266263
e.stopPropagation();
@@ -508,8 +505,11 @@ export const AppLayoutMixin = (superclass) =>
508505
/** @protected */
509506
_blockAnimationUntilAfterNextRender() {
510507
this.setAttribute('no-anim', '');
511-
afterNextRender(this, () => {
512-
this.removeAttribute('no-anim');
508+
509+
this.__debounceAnimation = Debouncer.debounce(this.__debounceAnimation, animationFrame, () => {
510+
setTimeout(() => {
511+
this.removeAttribute('no-anim');
512+
});
513513
});
514514
}
515515

0 commit comments

Comments
 (0)