@primer/view-components 0.6.1-rc.d24b77ad → 0.6.1-rc.e08ce435
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.
@@ -141,8 +141,11 @@ let ActionMenuElement = class ActionMenuElement extends HTMLElement {
|
|
141
141
|
return;
|
142
142
|
const ariaChecked = item.getAttribute('aria-checked');
|
143
143
|
const checked = ariaChecked !== 'true';
|
144
|
-
item.setAttribute('aria-checked', `${checked}`);
|
145
144
|
if (this.selectVariant === 'single') {
|
145
|
+
// Only check, never uncheck here. Single-select mode does not allow unchecking a checked item.
|
146
|
+
if (checked) {
|
147
|
+
item.setAttribute('aria-checked', 'true');
|
148
|
+
}
|
146
149
|
for (const checkedItem of this.querySelectorAll('[aria-checked]')) {
|
147
150
|
if (checkedItem !== item) {
|
148
151
|
checkedItem.setAttribute('aria-checked', 'false');
|
@@ -150,6 +153,10 @@ let ActionMenuElement = class ActionMenuElement extends HTMLElement {
|
|
150
153
|
}
|
151
154
|
__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_setDynamicLabel).call(this);
|
152
155
|
}
|
156
|
+
else {
|
157
|
+
// multi-select mode allows unchecking a checked item
|
158
|
+
item.setAttribute('aria-checked', `${checked}`);
|
159
|
+
}
|
153
160
|
__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_updateInput).call(this);
|
154
161
|
if (event instanceof KeyboardEvent && event.target instanceof HTMLButtonElement) {
|
155
162
|
// prevent buttons from being clicked twice
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@primer/view-components",
|
3
|
-
"version": "0.6.1-rc.
|
3
|
+
"version": "0.6.1-rc.e08ce435",
|
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",
|