Skip to content

Commit 31a1fe5

Browse files
authored
refactor: move how overlay max-width is set (#192)
Instead of setting max-width: none when a dialog is dragged or resized directly to the node style attribute, use a custom attribute which is used in a CSS selector to apply that style. It will prevent a custom max-width from being reset when user resizes or drags the dialog.
1 parent 84b9c49 commit 31a1fe5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/vaadin-dialog.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
[part="content"] {
2525
min-width: 12em; /* matches the default <vaadin-text-field> width */
2626
}
27+
28+
:host([has-bounds-set]) [part="overlay"] {
29+
max-width: none;
30+
}
2731
</style>
2832
</template>
2933
</dom-module>
@@ -395,7 +399,7 @@
395399

396400
if (overlay.style.position !== 'absolute') {
397401
overlay.style.position = 'absolute';
398-
overlay.style.maxWidth = 'none';
402+
this.$.overlay.setAttribute('has-bounds-set', '');
399403
this.__forceSafariReflow();
400404
}
401405

0 commit comments

Comments
 (0)