@vaadin/overlay 24.1.13 → 24.1.14
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 +7 -7
- package/src/vaadin-overlay.js +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/overlay",
|
|
3
|
-
"version": "24.1.
|
|
3
|
+
"version": "24.1.14",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
38
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/a11y-base": "~24.1.
|
|
40
|
-
"@vaadin/component-base": "~24.1.
|
|
41
|
-
"@vaadin/vaadin-lumo-styles": "~24.1.
|
|
42
|
-
"@vaadin/vaadin-material-styles": "~24.1.
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "~24.1.
|
|
39
|
+
"@vaadin/a11y-base": "~24.1.14",
|
|
40
|
+
"@vaadin/component-base": "~24.1.14",
|
|
41
|
+
"@vaadin/vaadin-lumo-styles": "~24.1.14",
|
|
42
|
+
"@vaadin/vaadin-material-styles": "~24.1.14",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "~24.1.14"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@esm-bundle/chai": "^4.3.4",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"lit": "^2.0.0",
|
|
49
49
|
"sinon": "^13.0.2"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "ddff030b439f28a7b7f61ceae706d3dd9564a2b4"
|
|
52
52
|
}
|
package/src/vaadin-overlay.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
|
|
7
7
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
8
|
+
import { getClosestFocusable } from '@vaadin/a11y-base/src/focus-utils.js';
|
|
8
9
|
import { isIOS } from '@vaadin/component-base/src/browser-utils.js';
|
|
9
10
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
10
11
|
import { processTemplates } from '@vaadin/component-base/src/templates.js';
|
|
@@ -294,6 +295,10 @@ class Overlay extends OverlayFocusMixin(ThemableMixin(DirMixin(PolymerElement)))
|
|
|
294
295
|
this.addEventListener('click', () => {});
|
|
295
296
|
this.$.backdrop.addEventListener('click', () => {});
|
|
296
297
|
|
|
298
|
+
this.addEventListener('mousedown', (e) => {
|
|
299
|
+
this._onMouseDown(e);
|
|
300
|
+
});
|
|
301
|
+
|
|
297
302
|
processTemplates(this);
|
|
298
303
|
}
|
|
299
304
|
|
|
@@ -703,6 +708,16 @@ class Overlay extends OverlayFocusMixin(ThemableMixin(DirMixin(PolymerElement)))
|
|
|
703
708
|
this.__zIndex = zIndex || parseFloat(getComputedStyle(this).zIndex);
|
|
704
709
|
}
|
|
705
710
|
|
|
711
|
+
/** @private */
|
|
712
|
+
_onMouseDown(event) {
|
|
713
|
+
const target = event.target;
|
|
714
|
+
const focusable = getClosestFocusable(target.focusElement || target);
|
|
715
|
+
if (focusable) {
|
|
716
|
+
event.preventDefault();
|
|
717
|
+
focusable.focus();
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
|
|
706
721
|
/**
|
|
707
722
|
* @event vaadin-overlay-open
|
|
708
723
|
* Fired after the overlay is opened.
|