@primer/view-components 0.1.9-rc.4a184d98 → 0.1.9-rc.c91f6e8b
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.
|
@@ -96,6 +96,7 @@ export class ModalDialogElement extends HTMLElement {
|
|
|
96
96
|
if (this.open)
|
|
97
97
|
return;
|
|
98
98
|
this.setAttribute('open', '');
|
|
99
|
+
this.setAttribute('aria-disabled', 'false');
|
|
99
100
|
(_a = __classPrivateFieldGet(this, _ModalDialogElement_instances, "a", _ModalDialogElement_overlayBackdrop_get)) === null || _a === void 0 ? void 0 : _a.classList.remove('Overlay--hidden');
|
|
100
101
|
document.body.style.paddingRight = `${window.innerWidth - document.body.clientWidth}px`;
|
|
101
102
|
document.body.style.overflow = 'hidden';
|
|
@@ -109,6 +110,7 @@ export class ModalDialogElement extends HTMLElement {
|
|
|
109
110
|
if (!this.open)
|
|
110
111
|
return;
|
|
111
112
|
this.removeAttribute('open');
|
|
113
|
+
this.setAttribute('aria-disabled', 'true');
|
|
112
114
|
(_b = __classPrivateFieldGet(this, _ModalDialogElement_instances, "a", _ModalDialogElement_overlayBackdrop_get)) === null || _b === void 0 ? void 0 : _b.classList.add('Overlay--hidden');
|
|
113
115
|
document.body.style.paddingRight = '0';
|
|
114
116
|
document.body.style.overflow = 'initial';
|
|
@@ -80,28 +80,34 @@ export default class FocusGroupElement extends HTMLElement {
|
|
|
80
80
|
if (key === 'Up' || key === 'ArrowUp') {
|
|
81
81
|
if (direction === 'vertical' || direction === 'both') {
|
|
82
82
|
index -= index < 0 ? 0 : 1;
|
|
83
|
+
event.preventDefault();
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
else if (key === 'Down' || key === 'ArrowDown') {
|
|
86
87
|
if (direction === 'vertical' || direction === 'both') {
|
|
87
88
|
index += 1;
|
|
89
|
+
event.preventDefault();
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
else if (event.key === 'Left' || event.key === 'ArrowLeft') {
|
|
91
93
|
if (direction === 'horizontal' || direction === 'both') {
|
|
92
94
|
index -= 1;
|
|
95
|
+
event.preventDefault();
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
else if (event.key === 'Right' || event.key === 'ArrowRight') {
|
|
96
99
|
if (direction === 'horizontal' || direction === 'both') {
|
|
97
100
|
index += 1;
|
|
101
|
+
event.preventDefault();
|
|
98
102
|
}
|
|
99
103
|
}
|
|
100
104
|
else if (event.key === 'Home' || event.key === 'PageUp') {
|
|
101
105
|
index = 0;
|
|
106
|
+
event.preventDefault();
|
|
102
107
|
}
|
|
103
108
|
else if (event.key === 'End' || event.key === 'PageDown') {
|
|
104
109
|
index = items.length - 1;
|
|
110
|
+
event.preventDefault();
|
|
105
111
|
}
|
|
106
112
|
else if (this.mnemonics && printable.test(key)) {
|
|
107
113
|
const mnemonic = key.toLowerCase();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/view-components",
|
|
3
|
-
"version": "0.1.9-rc.
|
|
3
|
+
"version": "0.1.9-rc.c91f6e8b",
|
|
4
4
|
"description": "ViewComponents for the Primer Design System",
|
|
5
5
|
"main": "app/assets/javascripts/primer_view_components.js",
|
|
6
6
|
"module": "app/components/primer/primer.js",
|