@vaadin/dialog 25.3.0-dev.1fa5a51482 → 25.3.0-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,6 +56,16 @@
56
56
  "description": "Set to true to remove backdrop and allow click events on background elements.",
57
57
  "attribute": "modeless"
58
58
  },
59
+ {
60
+ "kind": "field",
61
+ "name": "noAutofocus",
62
+ "privacy": "public",
63
+ "type": {
64
+ "text": "boolean"
65
+ },
66
+ "description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
67
+ "attribute": "no-autofocus"
68
+ },
59
69
  {
60
70
  "kind": "field",
61
71
  "name": "noCloseOnEsc",
@@ -83,7 +93,8 @@
83
93
  "type": {
84
94
  "text": "boolean"
85
95
  },
86
- "description": "Set to true to disable focus trapping.",
96
+ "description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
97
+ "deprecated": "This property is deprecated and will be removed in Vaadin 26.",
87
98
  "attribute": "no-focus-trap"
88
99
  },
89
100
  {
@@ -151,6 +162,14 @@
151
162
  "description": "Set to true to remove backdrop and allow click events on background elements.",
152
163
  "fieldName": "modeless"
153
164
  },
165
+ {
166
+ "name": "no-autofocus",
167
+ "type": {
168
+ "text": "boolean"
169
+ },
170
+ "description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
171
+ "fieldName": "noAutofocus"
172
+ },
154
173
  {
155
174
  "name": "no-close-on-esc",
156
175
  "type": {
@@ -172,7 +191,8 @@
172
191
  "type": {
173
192
  "text": "boolean"
174
193
  },
175
- "description": "Set to true to disable focus trapping.",
194
+ "description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
195
+ "deprecated": "This property is deprecated and will be removed in Vaadin 26.",
176
196
  "fieldName": "noFocusTrap"
177
197
  },
178
198
  {
@@ -326,6 +346,20 @@
326
346
  "description": "",
327
347
  "name": "DialogOverlayMixin",
328
348
  "members": [
349
+ {
350
+ "kind": "field",
351
+ "name": "autofocus",
352
+ "privacy": "public",
353
+ "type": {
354
+ "text": "boolean"
355
+ },
356
+ "description": "Set to true to move focus into the overlay automatically on open.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
357
+ "attribute": "autofocus",
358
+ "inheritedFrom": {
359
+ "name": "OverlayFocusMixin",
360
+ "package": "@vaadin/overlay/src/vaadin-overlay-focus-mixin.js"
361
+ }
362
+ },
329
363
  {
330
364
  "kind": "method",
331
365
  "name": "bringToFront",
@@ -351,6 +385,16 @@
351
385
  "package": "@vaadin/overlay/src/vaadin-overlay-mixin.js"
352
386
  }
353
387
  },
388
+ {
389
+ "kind": "method",
390
+ "name": "containsFocus",
391
+ "description": "Returns true if the overlay contains focus, including nested shadow roots.",
392
+ "return": {
393
+ "type": {
394
+ "text": "boolean"
395
+ }
396
+ }
397
+ },
354
398
  {
355
399
  "kind": "field",
356
400
  "name": "focusTrap",
@@ -358,7 +402,7 @@
358
402
  "type": {
359
403
  "text": "boolean"
360
404
  },
361
- "description": "When true, opening the overlay moves focus to the first focusable child,\nor to the overlay part with tabindex if there are no focusable children.",
405
+ "description": "Set to true to move focus into the overlay automatically on open\nand keep it inside: Tab and Shift+Tab cycle through the overlay's\ncontent until the overlay is closed.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
362
406
  "attribute": "focus-trap",
363
407
  "inheritedFrom": {
364
408
  "name": "OverlayFocusMixin",
@@ -570,12 +614,24 @@
570
614
  }
571
615
  ],
572
616
  "attributes": [
617
+ {
618
+ "name": "autofocus",
619
+ "type": {
620
+ "text": "boolean"
621
+ },
622
+ "description": "Set to true to move focus into the overlay automatically on open.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
623
+ "fieldName": "autofocus",
624
+ "inheritedFrom": {
625
+ "name": "OverlayFocusMixin",
626
+ "package": "@vaadin/overlay/src/vaadin-overlay-focus-mixin.js"
627
+ }
628
+ },
573
629
  {
574
630
  "name": "focus-trap",
575
631
  "type": {
576
632
  "text": "boolean"
577
633
  },
578
- "description": "When true, opening the overlay moves focus to the first focusable child,\nor to the overlay part with tabindex if there are no focusable children.",
634
+ "description": "Set to true to move focus into the overlay automatically on open\nand keep it inside: Tab and Shift+Tab cycle through the overlay's\ncontent until the overlay is closed.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
579
635
  "fieldName": "focusTrap",
580
636
  "inheritedFrom": {
581
637
  "name": "OverlayFocusMixin",
@@ -983,13 +1039,67 @@
983
1039
  }
984
1040
  ]
985
1041
  },
1042
+ {
1043
+ "kind": "javascript-module",
1044
+ "path": "src/vaadin-dialog-utils.js",
1045
+ "declarations": [
1046
+ {
1047
+ "kind": "class",
1048
+ "description": "Remembers where a pointer gesture started, to tell a click from a drag once it ends.",
1049
+ "name": "ClickTracker",
1050
+ "members": [
1051
+ {
1052
+ "kind": "method",
1053
+ "name": "isClick",
1054
+ "parameters": [
1055
+ {
1056
+ "name": "e",
1057
+ "type": {
1058
+ "text": "!MouseEvent | !TouchEvent"
1059
+ }
1060
+ }
1061
+ ],
1062
+ "description": "Returns true if the pointer hasn't moved since the gesture started.",
1063
+ "return": {
1064
+ "type": {
1065
+ "text": "boolean"
1066
+ }
1067
+ }
1068
+ },
1069
+ {
1070
+ "kind": "method",
1071
+ "name": "start",
1072
+ "parameters": [
1073
+ {
1074
+ "name": "e",
1075
+ "type": {
1076
+ "text": "!MouseEvent | !TouchEvent"
1077
+ }
1078
+ }
1079
+ ],
1080
+ "description": "Stores the position where the gesture started."
1081
+ }
1082
+ ]
1083
+ }
1084
+ ],
1085
+ "exports": [
1086
+ {
1087
+ "kind": "js",
1088
+ "name": "ClickTracker",
1089
+ "declaration": {
1090
+ "name": "ClickTracker",
1091
+ "module": "src/vaadin-dialog-utils.js"
1092
+ }
1093
+ }
1094
+ ]
1095
+ },
986
1096
  {
987
1097
  "kind": "javascript-module",
988
1098
  "path": "src/vaadin-dialog.js",
989
1099
  "declarations": [
990
1100
  {
991
1101
  "kind": "class",
992
- "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n```html\n<vaadin-dialog header-title=\"Title\">\n <div>Dialog content</div>\n <div slot=\"footer\">Footer</div>\n</vaadin-dialog>\n```\n\n### Slots\n\nDialog supports following slots for providing content:\n\nName | Description\n-----------------|-------------\n(none) | Default slot for the content\n`header-content` | Slot for the header content\n`footer` | Slot for the footer content\n\n#### Renderer (deprecated)\n\nThe content of the dialog can also be populated by using the renderer callback functions,\nalthough this approach is deprecated in favor of slotted content.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header content\n`has-footer` | Set when the element has footer content\n`overflow` | Set to `top`, `bottom`, none or both\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------|\n|`--vaadin-dialog-background` |\n|`--vaadin-dialog-border-color` |\n|`--vaadin-dialog-border-radius` |\n|`--vaadin-dialog-border-width` |\n|`--vaadin-dialog-max-width` |\n|`--vaadin-dialog-min-width` |\n|`--vaadin-dialog-overflow-indicator-color` |\n|`--vaadin-dialog-overflow-indicator-height` |\n|`--vaadin-dialog-padding` |\n|`--vaadin-dialog-shadow` |\n|`--vaadin-dialog-text-color` |\n|`--vaadin-dialog-title-color` |\n|`--vaadin-dialog-title-font-size` |\n|`--vaadin-dialog-title-font-weight` |\n|`--vaadin-dialog-title-line-height` |\n|`--vaadin-overlay-backdrop-background` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
1102
+ "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n```html\n<vaadin-dialog header-title=\"Title\">\n <div>Dialog content</div>\n <div slot=\"footer\">Footer</div>\n</vaadin-dialog>\n```\n\n### Slots\n\nDialog supports following slots for providing content:\n\nName | Description\n-----------------|-------------\n(none) | Default slot for the content\n`header-content` | Slot for the header content\n`footer` | Slot for the footer content\n\n#### Renderer (deprecated)\n\nThe content of the dialog can also be populated by using the renderer callback functions,\nalthough this approach is deprecated in favor of slotted content.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header content\n`has-footer` | Set when the element has footer content\n`overflow` | Set to `top`, `bottom`, none or both\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------|\n|`--vaadin-dialog-background` |\n|`--vaadin-dialog-border-color` |\n|`--vaadin-dialog-border-radius` |\n|`--vaadin-dialog-border-width` |\n|`--vaadin-dialog-max-width` |\n|`--vaadin-dialog-min-width` |\n|`--vaadin-dialog-overflow-indicator-color` |\n|`--vaadin-dialog-overflow-indicator-height` |\n|`--vaadin-dialog-padding` |\n|`--vaadin-dialog-shadow` |\n|`--vaadin-dialog-text-color` |\n|`--vaadin-dialog-title-color` |\n|`--vaadin-dialog-title-font-size` |\n|`--vaadin-dialog-title-font-weight` |\n|`--vaadin-dialog-title-line-height` |\n|`--vaadin-dialog-toolbar-gap` |\n|`--vaadin-overlay-backdrop-background` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
993
1103
  "name": "Dialog",
994
1104
  "members": [
995
1105
  {
@@ -1106,6 +1216,20 @@
1106
1216
  "module": "src/vaadin-dialog-base-mixin.js"
1107
1217
  }
1108
1218
  },
1219
+ {
1220
+ "kind": "field",
1221
+ "name": "noAutofocus",
1222
+ "privacy": "public",
1223
+ "type": {
1224
+ "text": "boolean"
1225
+ },
1226
+ "description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
1227
+ "attribute": "no-autofocus",
1228
+ "inheritedFrom": {
1229
+ "name": "DialogBaseMixin",
1230
+ "module": "src/vaadin-dialog-base-mixin.js"
1231
+ }
1232
+ },
1109
1233
  {
1110
1234
  "kind": "field",
1111
1235
  "name": "noCloseOnEsc",
@@ -1141,7 +1265,8 @@
1141
1265
  "type": {
1142
1266
  "text": "boolean"
1143
1267
  },
1144
- "description": "Set to true to disable focus trapping.",
1268
+ "description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
1269
+ "deprecated": "This property is deprecated and will be removed in Vaadin 26.",
1145
1270
  "attribute": "no-focus-trap",
1146
1271
  "inheritedFrom": {
1147
1272
  "name": "DialogBaseMixin",
@@ -1408,6 +1533,18 @@
1408
1533
  "module": "src/vaadin-dialog-base-mixin.js"
1409
1534
  }
1410
1535
  },
1536
+ {
1537
+ "name": "no-autofocus",
1538
+ "type": {
1539
+ "text": "boolean"
1540
+ },
1541
+ "description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
1542
+ "fieldName": "noAutofocus",
1543
+ "inheritedFrom": {
1544
+ "name": "DialogBaseMixin",
1545
+ "module": "src/vaadin-dialog-base-mixin.js"
1546
+ }
1547
+ },
1411
1548
  {
1412
1549
  "name": "no-close-on-esc",
1413
1550
  "type": {
@@ -1437,7 +1574,8 @@
1437
1574
  "type": {
1438
1575
  "text": "boolean"
1439
1576
  },
1440
- "description": "Set to true to disable focus trapping.",
1577
+ "description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
1578
+ "deprecated": "This property is deprecated and will be removed in Vaadin 26.",
1441
1579
  "fieldName": "noFocusTrap",
1442
1580
  "inheritedFrom": {
1443
1581
  "name": "DialogBaseMixin",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/dialog",
3
- "version": "25.3.0-dev.1fa5a51482",
3
+ "version": "25.3.0-rc1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,19 +37,20 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/component-base": "25.3.0-dev.1fa5a51482",
41
- "@vaadin/lit-renderer": "25.3.0-dev.1fa5a51482",
42
- "@vaadin/overlay": "25.3.0-dev.1fa5a51482",
43
- "@vaadin/vaadin-themable-mixin": "25.3.0-dev.1fa5a51482",
40
+ "@vaadin/a11y-base": "25.3.0-rc1",
41
+ "@vaadin/component-base": "25.3.0-rc1",
42
+ "@vaadin/lit-renderer": "25.3.0-rc1",
43
+ "@vaadin/overlay": "25.3.0-rc1",
44
+ "@vaadin/vaadin-themable-mixin": "25.3.0-rc1",
44
45
  "lit": "^3.0.0"
45
46
  },
46
47
  "devDependencies": {
47
- "@vaadin/a11y-base": "25.3.0-dev.1fa5a51482",
48
- "@vaadin/aura": "25.3.0-dev.1fa5a51482",
49
- "@vaadin/chai-plugins": "25.3.0-dev.1fa5a51482",
50
- "@vaadin/test-runner-commands": "25.3.0-dev.1fa5a51482",
48
+ "@vaadin/a11y-base": "25.3.0-beta3",
49
+ "@vaadin/aura": "25.3.0-rc1",
50
+ "@vaadin/chai-plugins": "25.3.0-rc1",
51
+ "@vaadin/test-runner-commands": "25.3.0-rc1",
51
52
  "@vaadin/testing-helpers": "^2.0.0",
52
- "@vaadin/vaadin-lumo-styles": "25.3.0-dev.1fa5a51482",
53
+ "@vaadin/vaadin-lumo-styles": "25.3.0-rc1",
53
54
  "sinon": "^22.0.0"
54
55
  },
55
56
  "customElements": "custom-elements.json",
@@ -57,5 +58,5 @@
57
58
  "web-types.json",
58
59
  "web-types.lit.json"
59
60
  ],
60
- "gitHead": "1cd5964b758ffbce3ddb6248a1997f55f8e0ebf6"
61
+ "gitHead": "d4809590b2f61bd607e376ab3dec84f4bfb059a7"
61
62
  }
@@ -33,11 +33,24 @@ export declare class DialogBaseMixinClass {
33
33
  modeless: boolean;
34
34
 
35
35
  /**
36
- * Set to true to disable focus trapping.
36
+ * Set to true to prevent the dialog from receiving focus
37
+ * on open and trapping it inside.
38
+ *
37
39
  * @attr {boolean} no-focus-trap
40
+ * @deprecated This property is deprecated and will be removed in Vaadin 26.
38
41
  */
39
42
  noFocusTrap: boolean;
40
43
 
44
+ /**
45
+ * Set to true to prevent focus from moving into the dialog on open.
46
+ *
47
+ * This property only works for non-modal dialogs and is ignored
48
+ * for modal ones, where focus must always stay inside.
49
+ *
50
+ * @attr {boolean} no-autofocus
51
+ */
52
+ noAutofocus: boolean;
53
+
41
54
  /**
42
55
  * The `role` attribute value to be set on the dialog. Defaults to "dialog".
43
56
  *
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2017 - 2026 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { setOrRemoveAttribute } from '@vaadin/component-base/src/dom-utils.js';
6
7
 
7
8
  export const DialogBaseMixin = (superClass) =>
8
9
  class DialogBaseMixin extends superClass {
@@ -46,14 +47,30 @@ export const DialogBaseMixin = (superClass) =>
46
47
  },
47
48
 
48
49
  /**
49
- * Set to true to disable focus trapping.
50
+ * Set to true to prevent the dialog from receiving focus
51
+ * on open and trapping it inside.
52
+ *
50
53
  * @attr {boolean} no-focus-trap
54
+ * @deprecated This property is deprecated and will be removed in Vaadin 26.
51
55
  */
52
56
  noFocusTrap: {
53
57
  type: Boolean,
54
58
  value: false,
55
59
  },
56
60
 
61
+ /**
62
+ * Set to true to prevent focus from moving into the dialog on open.
63
+ *
64
+ * This property only works for non-modal dialogs and is ignored
65
+ * for modal ones, where focus must always stay inside.
66
+ *
67
+ * @attr {boolean} no-autofocus
68
+ */
69
+ noAutofocus: {
70
+ type: Boolean,
71
+ value: false,
72
+ },
73
+
57
74
  /**
58
75
  * Set the distance of the dialog from the top of the viewport.
59
76
  * If a unitless number is provided, pixels are assumed.
@@ -134,11 +151,7 @@ export const DialogBaseMixin = (superClass) =>
134
151
  }
135
152
 
136
153
  if (props.has('modeless')) {
137
- if (!this.modeless) {
138
- this.setAttribute('aria-modal', 'true');
139
- } else {
140
- this.removeAttribute('aria-modal');
141
- }
154
+ setOrRemoveAttribute(this, 'aria-modal', !this.modeless);
142
155
  }
143
156
  }
144
157
 
@@ -3,8 +3,9 @@
3
3
  * Copyright (c) 2017 - 2026 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
6
7
  import { isTouch } from '@vaadin/component-base/src/browser-utils.js';
7
- import { eventInWindow, getMouseOrFirstTouchEvent } from './vaadin-dialog-utils.js';
8
+ import { ClickTracker, eventInWindow, getMouseOrFirstTouchEvent } from './vaadin-dialog-utils.js';
8
9
 
9
10
  export const DialogDraggableMixin = (superClass) =>
10
11
  class VaadinDialogDraggableMixin extends superClass {
@@ -44,6 +45,7 @@ export const DialogDraggableMixin = (superClass) =>
44
45
  super.ready();
45
46
  this._originalBounds = {};
46
47
  this._originalMouseCoords = {};
48
+ this.__dragTracker = new ClickTracker();
47
49
  this._startDrag = this._startDrag.bind(this);
48
50
  this._drag = this._drag.bind(this);
49
51
  this._stopDrag = this._stopDrag.bind(this);
@@ -86,6 +88,8 @@ export const DialogDraggableMixin = (superClass) =>
86
88
  if ((isResizerContainer && !isResizerContainerScrollbar) || isContentPart || isDraggable) {
87
89
  // Signal that we're handling this drag event, so parent dialogs won't also drag
88
90
  e.preventDefault();
91
+ // `preventDefault()` above cancels the native focus change, restored in `_stopDrag()`
92
+ this.__dragTracker.start(e);
89
93
  this._originalBounds = this.$.overlay.getBounds();
90
94
  const event = getMouseOrFirstTouchEvent(e);
91
95
  this._originalMouseCoords = { top: event.pageY, left: event.pageX };
@@ -128,7 +132,12 @@ export const DialogDraggableMixin = (superClass) =>
128
132
  }
129
133
 
130
134
  /** @private */
131
- _stopDrag() {
135
+ _stopDrag(e) {
136
+ // Focus on click, not on drag, so that moving the dialog doesn't interrupt editing
137
+ if (this.__dragTracker.isClick(e) && !this.$.overlay.containsFocus()) {
138
+ this.focus({ preventScroll: true, focusVisible: isKeyboardActive() });
139
+ }
140
+
132
141
  this.dispatchEvent(new CustomEvent('dragged', { detail: { top: this.top, left: this.left } }));
133
142
  window.removeEventListener('mouseup', this._stopDrag);
134
143
  window.removeEventListener('touchend', this._stopDrag);
@@ -44,4 +44,9 @@ export declare class DialogOverlayMixinClass {
44
44
  * Retrieves the coordinates of the overlay.
45
45
  */
46
46
  getBounds(): DialogOverlayBounds;
47
+
48
+ /**
49
+ * Returns true if the overlay contains focus, including nested shadow roots.
50
+ */
51
+ containsFocus(): boolean;
47
52
  }
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2017 - 2026 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { getDeepActiveElement } from '@vaadin/a11y-base/src/focus-utils.js';
6
7
  import { SlotObserver } from '@vaadin/component-base/src/slot-observer.js';
7
8
  import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
8
9
  import { setOverlayStateAttribute } from '@vaadin/overlay/src/vaadin-overlay-utils.js';
@@ -59,6 +60,15 @@ export const DialogOverlayMixin = (superClass) =>
59
60
  return this.owner;
60
61
  }
61
62
 
63
+ /**
64
+ * Returns true if the overlay contains focus, including nested shadow roots.
65
+ *
66
+ * @return {boolean}
67
+ */
68
+ containsFocus() {
69
+ return this._deepContains(getDeepActiveElement());
70
+ }
71
+
62
72
  /**
63
73
  * Override method from OverlayMixin to use slotted div as a renderer root.
64
74
  * @protected
@@ -21,9 +21,7 @@ import { DialogOverlayMixin } from './vaadin-dialog-overlay-mixin.js';
21
21
  * @extends HTMLElement
22
22
  * @private
23
23
  */
24
- export class DialogOverlay extends DialogOverlayMixin(
25
- DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))),
26
- ) {
24
+ class DialogOverlay extends DialogOverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
27
25
  static get is() {
28
26
  return 'vaadin-dialog-overlay';
29
27
  }
@@ -83,3 +81,5 @@ export class DialogOverlay extends DialogOverlayMixin(
83
81
  }
84
82
 
85
83
  defineCustomElement(DialogOverlay);
84
+
85
+ export { DialogOverlay };
@@ -3,7 +3,8 @@
3
3
  * Copyright (c) 2017 - 2026 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { eventInWindow, getMouseOrFirstTouchEvent } from './vaadin-dialog-utils.js';
6
+ import { isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
7
+ import { ClickTracker, eventInWindow, getMouseOrFirstTouchEvent } from './vaadin-dialog-utils.js';
7
8
  export const DialogResizableMixin = (superClass) =>
8
9
  class VaadinDialogResizableMixin extends superClass {
9
10
  static get properties() {
@@ -24,6 +25,7 @@ export const DialogResizableMixin = (superClass) =>
24
25
  super.ready();
25
26
  this._originalBounds = {};
26
27
  this._originalMouseCoords = {};
28
+ this.__resizeTracker = new ClickTracker();
27
29
  this._resizeListeners = { start: {}, resize: {}, stop: {} };
28
30
  this._addResizeListeners();
29
31
  }
@@ -35,7 +37,7 @@ export const DialogResizableMixin = (superClass) =>
35
37
  const resizer = document.createElement('div');
36
38
  this._resizeListeners.start[direction] = (e) => this._startResize(e, direction);
37
39
  this._resizeListeners.resize[direction] = (e) => this._resize(e, direction);
38
- this._resizeListeners.stop[direction] = () => this._stopResize(direction);
40
+ this._resizeListeners.stop[direction] = (e) => this._stopResize(e, direction);
39
41
  if (direction.length === 1) {
40
42
  resizer.classList.add('edge');
41
43
  }
@@ -60,6 +62,8 @@ export const DialogResizableMixin = (superClass) =>
60
62
 
61
63
  if (e.button === 0 || e.touches) {
62
64
  e.preventDefault();
65
+ // `preventDefault()` above cancels the native focus change, restored in `_stopResize()`
66
+ this.__resizeTracker.start(e);
63
67
 
64
68
  this._originalBounds = this.$.overlay.getBounds();
65
69
  const event = getMouseOrFirstTouchEvent(e);
@@ -127,10 +131,16 @@ export const DialogResizableMixin = (superClass) =>
127
131
  }
128
132
 
129
133
  /**
134
+ * @param {!MouseEvent | !TouchEvent} e
130
135
  * @param {!DialogResizableDirection} direction
131
136
  * @protected
132
137
  */
133
- _stopResize(direction) {
138
+ _stopResize(e, direction) {
139
+ // Focus on click, not on resize, so that resizing the dialog doesn't interrupt editing
140
+ if (this.__resizeTracker.isClick(e) && !this.$.overlay.containsFocus()) {
141
+ this.focus({ preventScroll: true, focusVisible: isKeyboardActive() });
142
+ }
143
+
134
144
  window.removeEventListener('mousemove', this._resizeListeners.resize[direction]);
135
145
  window.removeEventListener('touchmove', this._resizeListeners.resize[direction]);
136
146
  window.removeEventListener('mouseup', this._resizeListeners.stop[direction]);
@@ -6,6 +6,7 @@
6
6
 
7
7
  /**
8
8
  * Checks if the argument is a touch event and if so, returns a first touch.
9
+ * On `touchend`, `touches` is empty and the released point is in `changedTouches`.
9
10
  * Otherwise, if the mouse event was passed, returns it as is.
10
11
  */
11
12
  declare function getMouseOrFirstTouchEvent(e: MouseEvent | TouchEvent): MouseEvent | Touch;
@@ -18,3 +19,18 @@ export { getMouseOrFirstTouchEvent };
18
19
  declare function eventInWindow(e: MouseEvent | TouchEvent): boolean;
19
20
 
20
21
  export { eventInWindow };
22
+
23
+ /**
24
+ * Remembers where a pointer gesture started, to tell a click from a drag once it ends.
25
+ */
26
+ export declare class ClickTracker {
27
+ /**
28
+ * Stores the position where the gesture started.
29
+ */
30
+ start(e: MouseEvent | TouchEvent): void;
31
+
32
+ /**
33
+ * Returns true if the pointer hasn't moved since the gesture started.
34
+ */
35
+ isClick(e: MouseEvent | TouchEvent): boolean;
36
+ }
@@ -6,13 +6,14 @@
6
6
 
7
7
  /**
8
8
  * Checks if the argument is a touch event and if so, returns a first touch.
9
+ * On `touchend`, `touches` is empty and the released point is in `changedTouches`.
9
10
  * Otherwise, if the mouse event was passed, returns it as is.
10
11
  * @param {!MouseEvent | !TouchEvent} e
11
12
  * @return {!MouseEvent | !Touch}
12
13
  * @protected
13
14
  */
14
15
  export function getMouseOrFirstTouchEvent(e) {
15
- return e.touches ? e.touches[0] : e;
16
+ return e.touches ? e.touches[0] || e.changedTouches[0] : e;
16
17
  }
17
18
 
18
19
  /**
@@ -24,3 +25,35 @@ export function getMouseOrFirstTouchEvent(e) {
24
25
  export function eventInWindow(e) {
25
26
  return e.clientX >= 0 && e.clientX <= window.innerWidth && e.clientY >= 0 && e.clientY <= window.innerHeight;
26
27
  }
28
+
29
+ // Pointer movement in pixels above which a gesture is a drag, not a click.
30
+ // Same value as `TRACK_DISTANCE` in `@vaadin/component-base/src/gestures.js`.
31
+ const DRAG_DISTANCE = 5;
32
+
33
+ /**
34
+ * Remembers where a pointer gesture started, to tell a click from a drag once it ends.
35
+ */
36
+ export class ClickTracker {
37
+ /** @type {{ x: number, y: number }} */
38
+ #start;
39
+
40
+ /**
41
+ * Stores the position where the gesture started.
42
+ * @param {!MouseEvent | !TouchEvent} e
43
+ */
44
+ start(e) {
45
+ // Viewport coordinates, so scrolling during the gesture doesn't count as movement
46
+ const { clientX, clientY } = getMouseOrFirstTouchEvent(e);
47
+ this.#start = { x: clientX, y: clientY };
48
+ }
49
+
50
+ /**
51
+ * Returns true if the pointer hasn't moved since the gesture started.
52
+ * @param {!MouseEvent | !TouchEvent} e
53
+ * @return {boolean}
54
+ */
55
+ isClick(e) {
56
+ const { clientX, clientY } = getMouseOrFirstTouchEvent(e);
57
+ return Math.abs(clientX - this.#start.x) < DRAG_DISTANCE && Math.abs(clientY - this.#start.y) < DRAG_DISTANCE;
58
+ }
59
+ }
@@ -162,6 +162,7 @@ export type DialogEventMap = DialogCustomEventMap & HTMLElementEventMap;
162
162
  * |`--vaadin-dialog-title-font-size` |
163
163
  * |`--vaadin-dialog-title-font-weight` |
164
164
  * |`--vaadin-dialog-title-line-height` |
165
+ * |`--vaadin-dialog-toolbar-gap` |
165
166
  * |`--vaadin-overlay-backdrop-background` |
166
167
  *
167
168
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
@@ -105,6 +105,7 @@ export { DialogOverlay } from './vaadin-dialog-overlay.js';
105
105
  * |`--vaadin-dialog-title-font-size` |
106
106
  * |`--vaadin-dialog-title-font-weight` |
107
107
  * |`--vaadin-dialog-title-line-height` |
108
+ * |`--vaadin-dialog-toolbar-gap` |
108
109
  * |`--vaadin-overlay-backdrop-background` |
109
110
  *
110
111
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
@@ -172,7 +173,8 @@ class Dialog extends DialogSizeMixin(
172
173
  .withBackdrop="${!this.modeless}"
173
174
  ?resizable="${this.resizable}"
174
175
  restore-focus-on-close
175
- ?focus-trap="${!this.noFocusTrap}"
176
+ ?focus-trap="${!this.noFocusTrap && !this.modeless}"
177
+ ?autofocus="${this.modeless ? !this.noAutofocus && !this.noFocusTrap : !this.noFocusTrap}"
176
178
  exportparts="backdrop, overlay, header, title, header-content, content, footer"
177
179
  >
178
180
  <slot name="title" slot="title"></slot>
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/dialog",
4
- "version": "25.3.0-dev.1fa5a51482",
4
+ "version": "25.3.0-rc1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-dialog",
11
- "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n```html\n<vaadin-dialog header-title=\"Title\">\n <div>Dialog content</div>\n <div slot=\"footer\">Footer</div>\n</vaadin-dialog>\n```\n\n### Slots\n\nDialog supports following slots for providing content:\n\nName | Description\n-----------------|-------------\n(none) | Default slot for the content\n`header-content` | Slot for the header content\n`footer` | Slot for the footer content\n\n#### Renderer (deprecated)\n\nThe content of the dialog can also be populated by using the renderer callback functions,\nalthough this approach is deprecated in favor of slotted content.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header content\n`has-footer` | Set when the element has footer content\n`overflow` | Set to `top`, `bottom`, none or both\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------|\n|`--vaadin-dialog-background` |\n|`--vaadin-dialog-border-color` |\n|`--vaadin-dialog-border-radius` |\n|`--vaadin-dialog-border-width` |\n|`--vaadin-dialog-max-width` |\n|`--vaadin-dialog-min-width` |\n|`--vaadin-dialog-overflow-indicator-color` |\n|`--vaadin-dialog-overflow-indicator-height` |\n|`--vaadin-dialog-padding` |\n|`--vaadin-dialog-shadow` |\n|`--vaadin-dialog-text-color` |\n|`--vaadin-dialog-title-color` |\n|`--vaadin-dialog-title-font-size` |\n|`--vaadin-dialog-title-font-weight` |\n|`--vaadin-dialog-title-line-height` |\n|`--vaadin-overlay-backdrop-background` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
11
+ "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n```html\n<vaadin-dialog header-title=\"Title\">\n <div>Dialog content</div>\n <div slot=\"footer\">Footer</div>\n</vaadin-dialog>\n```\n\n### Slots\n\nDialog supports following slots for providing content:\n\nName | Description\n-----------------|-------------\n(none) | Default slot for the content\n`header-content` | Slot for the header content\n`footer` | Slot for the footer content\n\n#### Renderer (deprecated)\n\nThe content of the dialog can also be populated by using the renderer callback functions,\nalthough this approach is deprecated in favor of slotted content.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header content\n`has-footer` | Set when the element has footer content\n`overflow` | Set to `top`, `bottom`, none or both\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------|\n|`--vaadin-dialog-background` |\n|`--vaadin-dialog-border-color` |\n|`--vaadin-dialog-border-radius` |\n|`--vaadin-dialog-border-width` |\n|`--vaadin-dialog-max-width` |\n|`--vaadin-dialog-min-width` |\n|`--vaadin-dialog-overflow-indicator-color` |\n|`--vaadin-dialog-overflow-indicator-height` |\n|`--vaadin-dialog-padding` |\n|`--vaadin-dialog-shadow` |\n|`--vaadin-dialog-text-color` |\n|`--vaadin-dialog-title-color` |\n|`--vaadin-dialog-title-font-size` |\n|`--vaadin-dialog-title-font-weight` |\n|`--vaadin-dialog-title-line-height` |\n|`--vaadin-dialog-toolbar-gap` |\n|`--vaadin-overlay-backdrop-background` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "draggable",
@@ -64,6 +64,15 @@
64
64
  ]
65
65
  }
66
66
  },
67
+ {
68
+ "name": "no-autofocus",
69
+ "description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
70
+ "value": {
71
+ "type": [
72
+ "boolean"
73
+ ]
74
+ }
75
+ },
67
76
  {
68
77
  "name": "no-close-on-esc",
69
78
  "description": "Set to true to disable closing dialog on Escape press",
@@ -84,7 +93,7 @@
84
93
  },
85
94
  {
86
95
  "name": "no-focus-trap",
87
- "description": "Set to true to disable focus trapping.",
96
+ "description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
88
97
  "value": {
89
98
  "type": [
90
99
  "boolean"
@@ -222,6 +231,15 @@
222
231
  ]
223
232
  }
224
233
  },
234
+ {
235
+ "name": "noAutofocus",
236
+ "description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
237
+ "value": {
238
+ "type": [
239
+ "boolean"
240
+ ]
241
+ }
242
+ },
225
243
  {
226
244
  "name": "noCloseOnEsc",
227
245
  "description": "Set to true to disable closing dialog on Escape press",
@@ -242,7 +260,7 @@
242
260
  },
243
261
  {
244
262
  "name": "noFocusTrap",
245
- "description": "Set to true to disable focus trapping.",
263
+ "description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
246
264
  "value": {
247
265
  "type": [
248
266
  "boolean"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/dialog",
4
- "version": "25.3.0-dev.1fa5a51482",
4
+ "version": "25.3.0-rc1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-dialog",
19
- "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n```html\n<vaadin-dialog header-title=\"Title\">\n <div>Dialog content</div>\n <div slot=\"footer\">Footer</div>\n</vaadin-dialog>\n```\n\n### Slots\n\nDialog supports following slots for providing content:\n\nName | Description\n-----------------|-------------\n(none) | Default slot for the content\n`header-content` | Slot for the header content\n`footer` | Slot for the footer content\n\n#### Renderer (deprecated)\n\nThe content of the dialog can also be populated by using the renderer callback functions,\nalthough this approach is deprecated in favor of slotted content.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header content\n`has-footer` | Set when the element has footer content\n`overflow` | Set to `top`, `bottom`, none or both\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------|\n|`--vaadin-dialog-background` |\n|`--vaadin-dialog-border-color` |\n|`--vaadin-dialog-border-radius` |\n|`--vaadin-dialog-border-width` |\n|`--vaadin-dialog-max-width` |\n|`--vaadin-dialog-min-width` |\n|`--vaadin-dialog-overflow-indicator-color` |\n|`--vaadin-dialog-overflow-indicator-height` |\n|`--vaadin-dialog-padding` |\n|`--vaadin-dialog-shadow` |\n|`--vaadin-dialog-text-color` |\n|`--vaadin-dialog-title-color` |\n|`--vaadin-dialog-title-font-size` |\n|`--vaadin-dialog-title-font-weight` |\n|`--vaadin-dialog-title-line-height` |\n|`--vaadin-overlay-backdrop-background` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
19
+ "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n```html\n<vaadin-dialog header-title=\"Title\">\n <div>Dialog content</div>\n <div slot=\"footer\">Footer</div>\n</vaadin-dialog>\n```\n\n### Slots\n\nDialog supports following slots for providing content:\n\nName | Description\n-----------------|-------------\n(none) | Default slot for the content\n`header-content` | Slot for the header content\n`footer` | Slot for the footer content\n\n#### Renderer (deprecated)\n\nThe content of the dialog can also be populated by using the renderer callback functions,\nalthough this approach is deprecated in favor of slotted content.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header content\n`has-footer` | Set when the element has footer content\n`overflow` | Set to `top`, `bottom`, none or both\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:--------------------------------------------|\n|`--vaadin-dialog-background` |\n|`--vaadin-dialog-border-color` |\n|`--vaadin-dialog-border-radius` |\n|`--vaadin-dialog-border-width` |\n|`--vaadin-dialog-max-width` |\n|`--vaadin-dialog-min-width` |\n|`--vaadin-dialog-overflow-indicator-color` |\n|`--vaadin-dialog-overflow-indicator-height` |\n|`--vaadin-dialog-padding` |\n|`--vaadin-dialog-shadow` |\n|`--vaadin-dialog-text-color` |\n|`--vaadin-dialog-title-color` |\n|`--vaadin-dialog-title-font-size` |\n|`--vaadin-dialog-title-font-weight` |\n|`--vaadin-dialog-title-line-height` |\n|`--vaadin-dialog-toolbar-gap` |\n|`--vaadin-overlay-backdrop-background` |\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -75,6 +75,13 @@
75
75
  "kind": "expression"
76
76
  }
77
77
  },
78
+ {
79
+ "name": "?noAutofocus",
80
+ "description": "Set to true to prevent focus from moving into the dialog on open.\n\nThis property only works for non-modal dialogs and is ignored\nfor modal ones, where focus must always stay inside.",
81
+ "value": {
82
+ "kind": "expression"
83
+ }
84
+ },
78
85
  {
79
86
  "name": "?noCloseOnEsc",
80
87
  "description": "Set to true to disable closing dialog on Escape press",
@@ -91,7 +98,7 @@
91
98
  },
92
99
  {
93
100
  "name": "?noFocusTrap",
94
- "description": "Set to true to disable focus trapping.",
101
+ "description": "Set to true to prevent the dialog from receiving focus\non open and trapping it inside.",
95
102
  "value": {
96
103
  "kind": "expression"
97
104
  }