From 342a9b40c367acfe8fb0aa6a8648acf43523866f Mon Sep 17 00:00:00 2001 From: web-padawan Date: Tue, 20 Aug 2024 12:24:07 +0300 Subject: [PATCH 1/3] fix: allow to change overlay dir attribute while opened --- .../overlay/src/vaadin-overlay-position-mixin.js | 1 - packages/overlay/test/position-mixin.common.js | 12 ++++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/overlay/src/vaadin-overlay-position-mixin.js b/packages/overlay/src/vaadin-overlay-position-mixin.js index b101ba211c..d6638621d8 100644 --- a/packages/overlay/src/vaadin-overlay-position-mixin.js +++ b/packages/overlay/src/vaadin-overlay-position-mixin.js @@ -203,7 +203,6 @@ export const PositionMixin = (superClass) => this.__margins[propName] = parseInt(computedStyle[propName], 10); }); } - this.setAttribute('dir', computedStyle.direction); this._updatePosition(); // Schedule another position update (to cover virtual keyboard opening for example) diff --git a/packages/overlay/test/position-mixin.common.js b/packages/overlay/test/position-mixin.common.js index 7f09378b33..ccf57b5e6c 100644 --- a/packages/overlay/test/position-mixin.common.js +++ b/packages/overlay/test/position-mixin.common.js @@ -376,11 +376,9 @@ describe('position mixin', () => { }); it('should align right edges with right-to-left', async () => { - overlay.opened = false; - await nextUpdate(overlay); document.dir = 'rtl'; - overlay.opened = true; - await nextUpdate(overlay); + await nextRender(); + updatePosition(); expectEdgesAligned(RIGHT, RIGHT); }); @@ -483,11 +481,9 @@ describe('position mixin', () => { }); it('should align left edges with right-to-left', async () => { - overlay.opened = false; - await nextUpdate(overlay); document.dir = 'rtl'; - overlay.opened = true; - await nextUpdate(overlay); + await nextRender(); + updatePosition(); expectEdgesAligned(LEFT, LEFT); }); From e1d6517c008784164669b2bdb461b7e0e30bd210 Mon Sep 17 00:00:00 2001 From: web-padawan Date: Tue, 20 Aug 2024 12:49:45 +0300 Subject: [PATCH 2/3] test: update snapshots to remove default dir attribute --- .../test/dom/__snapshots__/avatar-group.test.snap.js | 2 -- .../test/dom/__snapshots__/combo-box.test.snap.js | 3 --- .../test/dom/__snapshots__/context-menu.test.snap.js | 8 +------- .../test/dom/__snapshots__/date-picker.test.snap.js | 3 --- .../test/dom/__snapshots__/date-time-picker.test.snap.js | 1 - .../menu-bar/test/dom/__snapshots__/menu-bar.test.snap.js | 2 -- .../select/test/dom/__snapshots__/select.test.snap.js | 2 -- .../tooltip/test/dom/__snapshots__/tooltip.test.snap.js | 2 -- 8 files changed, 1 insertion(+), 22 deletions(-) diff --git a/packages/avatar-group/test/dom/__snapshots__/avatar-group.test.snap.js b/packages/avatar-group/test/dom/__snapshots__/avatar-group.test.snap.js index 1d118e2705..2371b9b30c 100644 --- a/packages/avatar-group/test/dom/__snapshots__/avatar-group.test.snap.js +++ b/packages/avatar-group/test/dom/__snapshots__/avatar-group.test.snap.js @@ -139,7 +139,6 @@ snapshots["vaadin-avatar-group opened default"] = snapshots["vaadin-avatar-group opened overlay"] = ` +`