@ewc-lib/ewc-popovers 2.0.2-beta → 2.0.3-beta
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/ewc-popover/src/element.js +1 -1
- package/ewc-popover-sharing/src/element.js +19 -20
- package/package.json +1 -1
- package/readme.md +4 -1
|
@@ -14,7 +14,7 @@ export default class Element extends HTMLElement {
|
|
|
14
14
|
|
|
15
15
|
connectedCallback(ignoreCheck) {
|
|
16
16
|
if(this.#isInitialized) { return } else { this.#isInitialized=true }
|
|
17
|
-
this.setAttribute("ewc-version", "2.0.
|
|
17
|
+
this.setAttribute("ewc-version", "2.0.3-beta") // please always keep in sync with version in package.json
|
|
18
18
|
if(ignoreCheck || this.childElementCount===2) {
|
|
19
19
|
// please see also comment in html.js
|
|
20
20
|
|
|
@@ -67,26 +67,25 @@ export default class Element extends Popover {
|
|
|
67
67
|
this.shadowRoot.querySelector(".ewc-popover__container").addEventListener(
|
|
68
68
|
"keydown",
|
|
69
69
|
(e) => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
70
|
+
if(e.key==="ArrowDown" || (e.key==="Tab" && !e.shiftKey)) {
|
|
71
|
+
handle(
|
|
72
|
+
(e) => e.nextElementSibling,
|
|
73
|
+
(e) => e.parentNode.firstElementChild,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
if(e.key==="ArrowUp" || (e.key==="Tab" && e.shiftKey)) {
|
|
77
|
+
handle(
|
|
78
|
+
(e) => e.previousElementSibling,
|
|
79
|
+
(e) => e.parentNode.lastElementChild,
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
function handle(directionNext, wrapTo) {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
const el = directionNext(e.target.closest("li"));
|
|
85
|
+
if (el) {
|
|
86
|
+
el.focus();
|
|
87
|
+
} else {
|
|
88
|
+
wrapTo(e.target.closest("li")).focus();
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
91
|
},
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@ewc-lib/ewc-popovers",
|
|
3
3
|
"description": "Monorepo for EWCL popover WebComponents",
|
|
4
4
|
"//": "please always keep version in sync with version info in the sourcecode",
|
|
5
|
-
"version": "2.0.
|
|
5
|
+
"version": "2.0.3-beta",
|
|
6
6
|
"workspaces": [
|
|
7
7
|
"ewc-popover",
|
|
8
8
|
"ewc-popover-sharing"
|