@vaadin/popover 25.3.1 → 25.3.2

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.
@@ -69,7 +69,7 @@
69
69
  "type": {
70
70
  "text": "boolean"
71
71
  },
72
- "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.",
72
+ "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.\n\nAn element inside the overlay that has `autofocus` set, such as\n`<vaadin-text-field autofocus>`, receives focus on open instead,\neven when this property is false.",
73
73
  "attribute": "autofocus",
74
74
  "inheritedFrom": {
75
75
  "name": "OverlayFocusMixin",
@@ -374,7 +374,7 @@
374
374
  "type": {
375
375
  "text": "boolean"
376
376
  },
377
- "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.",
377
+ "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.\n\nAn element inside the overlay that has `autofocus` set, such as\n`<vaadin-text-field autofocus>`, receives focus on open instead,\neven when this property is false.",
378
378
  "fieldName": "autofocus",
379
379
  "inheritedFrom": {
380
380
  "name": "OverlayFocusMixin",
@@ -751,7 +751,7 @@
751
751
  "type": {
752
752
  "text": "boolean"
753
753
  },
754
- "description": "When true, the popover content automatically receives focus after\nit is opened. Modal popovers use this behavior by default.",
754
+ "description": "When true, the popover content automatically receives focus after\nit is opened. Modal popovers use this behavior by default.\n\nA field with `autofocus` inside the popover receives focus on open\neven when this is false.",
755
755
  "attribute": "autofocus"
756
756
  },
757
757
  {
@@ -1037,7 +1037,7 @@
1037
1037
  "type": {
1038
1038
  "text": "boolean"
1039
1039
  },
1040
- "description": "When true, the popover content automatically receives focus after\nit is opened. Modal popovers use this behavior by default.",
1040
+ "description": "When true, the popover content automatically receives focus after\nit is opened. Modal popovers use this behavior by default.\n\nA field with `autofocus` inside the popover receives focus on open\neven when this is false.",
1041
1041
  "fieldName": "autofocus"
1042
1042
  },
1043
1043
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/popover",
3
- "version": "25.3.1",
3
+ "version": "25.3.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,19 +37,19 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/a11y-base": "~25.3.1",
41
- "@vaadin/component-base": "~25.3.1",
42
- "@vaadin/lit-renderer": "~25.3.1",
43
- "@vaadin/overlay": "~25.3.1",
44
- "@vaadin/vaadin-themable-mixin": "~25.3.1",
40
+ "@vaadin/a11y-base": "~25.3.2",
41
+ "@vaadin/component-base": "~25.3.2",
42
+ "@vaadin/lit-renderer": "~25.3.2",
43
+ "@vaadin/overlay": "~25.3.2",
44
+ "@vaadin/vaadin-themable-mixin": "~25.3.2",
45
45
  "lit": "^3.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@vaadin/aura": "~25.3.1",
49
- "@vaadin/chai-plugins": "~25.3.1",
50
- "@vaadin/test-runner-commands": "~25.3.1",
48
+ "@vaadin/aura": "~25.3.2",
49
+ "@vaadin/chai-plugins": "~25.3.2",
50
+ "@vaadin/test-runner-commands": "~25.3.2",
51
51
  "@vaadin/testing-helpers": "^2.0.0",
52
- "@vaadin/vaadin-lumo-styles": "~25.3.1",
52
+ "@vaadin/vaadin-lumo-styles": "~25.3.2",
53
53
  "sinon": "^22.0.0"
54
54
  },
55
55
  "customElements": "custom-elements.json",
@@ -57,5 +57,5 @@
57
57
  "web-types.json",
58
58
  "web-types.lit.json"
59
59
  ],
60
- "gitHead": "a652d6071d7ad5add8465772f14f3efe633066a8"
60
+ "gitHead": "3f75254a3f77da3977cb79a77f549f37b8a5d54e"
61
61
  }
@@ -114,6 +114,9 @@ declare class Popover extends PopoverPositionMixin(PopoverTargetMixin(ThemePrope
114
114
  /**
115
115
  * When true, the popover content automatically receives focus after
116
116
  * it is opened. Modal popovers use this behavior by default.
117
+ *
118
+ * A field with `autofocus` inside the popover receives focus on open
119
+ * even when this is false.
117
120
  */
118
121
  autofocus: boolean;
119
122
 
@@ -6,7 +6,7 @@
6
6
  import './vaadin-popover-overlay.js';
7
7
  import { css, html, LitElement } from 'lit';
8
8
  import { ifDefined } from 'lit/directives/if-defined.js';
9
- import { isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
9
+ import { getDeepActiveElement, isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
10
10
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
11
11
  import { setOrRemoveAttribute } from '@vaadin/component-base/src/dom-utils.js';
12
12
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
@@ -274,6 +274,9 @@ class Popover extends PopoverPositionMixin(
274
274
  /**
275
275
  * When true, the popover content automatically receives focus after
276
276
  * it is opened. Modal popovers use this behavior by default.
277
+ *
278
+ * A field with `autofocus` inside the popover receives focus on open
279
+ * even when this is false.
277
280
  */
278
281
  autofocus: {
279
282
  type: Boolean,
@@ -897,7 +900,8 @@ class Popover extends PopoverPositionMixin(
897
900
 
898
901
  /** @private */
899
902
  __onOverlayOpened() {
900
- if (this.autofocus && !this.modal) {
903
+ // Do not take focus from the content, e.g. from an element with `autofocus`
904
+ if (this.autofocus && !this.modal && !this._overlayElement._deepContains(getDeepActiveElement())) {
901
905
  this.focus();
902
906
  }
903
907
  }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/popover",
4
- "version": "25.3.1",
4
+ "version": "25.3.2",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -30,7 +30,7 @@
30
30
  },
31
31
  {
32
32
  "name": "autofocus",
33
- "description": "When true, the popover content automatically receives focus after\nit is opened. Modal popovers use this behavior by default.",
33
+ "description": "When true, the popover content automatically receives focus after\nit is opened. Modal popovers use this behavior by default.\n\nA field with `autofocus` inside the popover receives focus on open\neven when this is false.",
34
34
  "value": {
35
35
  "type": [
36
36
  "boolean"
@@ -204,7 +204,7 @@
204
204
  },
205
205
  {
206
206
  "name": "autofocus",
207
- "description": "When true, the popover content automatically receives focus after\nit is opened. Modal popovers use this behavior by default.",
207
+ "description": "When true, the popover content automatically receives focus after\nit is opened. Modal popovers use this behavior by default.\n\nA field with `autofocus` inside the popover receives focus on open\neven when this is false.",
208
208
  "value": {
209
209
  "type": [
210
210
  "boolean"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/popover",
4
- "version": "25.3.1",
4
+ "version": "25.3.2",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -35,7 +35,7 @@
35
35
  },
36
36
  {
37
37
  "name": "?autofocus",
38
- "description": "When true, the popover content automatically receives focus after\nit is opened. Modal popovers use this behavior by default.",
38
+ "description": "When true, the popover content automatically receives focus after\nit is opened. Modal popovers use this behavior by default.\n\nA field with `autofocus` inside the popover receives focus on open\neven when this is false.",
39
39
  "value": {
40
40
  "kind": "expression"
41
41
  }