@vaadin/overlay 23.3.27 → 23.3.28

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/overlay",
3
- "version": "23.3.27",
3
+ "version": "23.3.28",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,20 +36,20 @@
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/component-base": "~23.3.27",
40
- "@vaadin/vaadin-lumo-styles": "~23.3.27",
41
- "@vaadin/vaadin-material-styles": "~23.3.27",
42
- "@vaadin/vaadin-themable-mixin": "~23.3.27"
39
+ "@vaadin/component-base": "~23.3.28",
40
+ "@vaadin/vaadin-lumo-styles": "~23.3.28",
41
+ "@vaadin/vaadin-material-styles": "~23.3.28",
42
+ "@vaadin/vaadin-themable-mixin": "~23.3.28"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@esm-bundle/chai": "^4.3.4",
46
46
  "@polymer/iron-overlay-behavior": "^3.0.0",
47
- "@vaadin/button": "~23.3.27",
48
- "@vaadin/radio-group": "~23.3.27",
47
+ "@vaadin/button": "~23.3.28",
48
+ "@vaadin/radio-group": "~23.3.28",
49
49
  "@vaadin/testing-helpers": "^0.3.2",
50
- "@vaadin/text-field": "~23.3.27",
50
+ "@vaadin/text-field": "~23.3.28",
51
51
  "lit": "^2.0.0",
52
52
  "sinon": "^13.0.2"
53
53
  },
54
- "gitHead": "2e7ac196558d143a8fececcd7e146ff6a03c61f5"
54
+ "gitHead": "060cd64f1a65c61904446c9725a8fe5d6c8f218c"
55
55
  }
@@ -11,6 +11,7 @@ import { isIOS } from '@vaadin/component-base/src/browser-utils.js';
11
11
  import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
12
12
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
13
13
  import { FocusTrapController } from '@vaadin/component-base/src/focus-trap-controller.js';
14
+ import { getClosestFocusable } from '@vaadin/component-base/src/focus-utils.js';
14
15
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
15
16
 
16
17
  /**
@@ -376,6 +377,10 @@ class Overlay extends ThemableMixin(DirMixin(ControllerMixin(PolymerElement))) {
376
377
  this.$.backdrop.addEventListener('click', () => {});
377
378
 
378
379
  this.addController(this.__focusTrapController);
380
+
381
+ this.addEventListener('mousedown', (e) => {
382
+ this._onMouseDown(e);
383
+ });
379
384
  }
380
385
 
381
386
  /** @private */
@@ -986,6 +991,16 @@ class Overlay extends ThemableMixin(DirMixin(ControllerMixin(PolymerElement))) {
986
991
  this.style.zIndex = zIndex;
987
992
  this.__zIndex = zIndex || parseFloat(getComputedStyle(this).zIndex);
988
993
  }
994
+
995
+ /** @private */
996
+ _onMouseDown(event) {
997
+ const target = event.target;
998
+ const focusable = getClosestFocusable(target.focusElement || target);
999
+ if (focusable) {
1000
+ event.preventDefault();
1001
+ focusable.focus();
1002
+ }
1003
+ }
989
1004
  }
990
1005
 
991
1006
  customElements.define(Overlay.is, Overlay);