@brightspace-ui/core 3.151.4 → 3.151.5
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.
@@ -114,7 +114,8 @@ export const DropdownOpenerMixin = superclass => class extends superclass {
|
|
114
114
|
this.addEventListener('d2l-dropdown-open', this.__onOpened);
|
115
115
|
this.addEventListener('d2l-dropdown-close', this.__onClosed);
|
116
116
|
const content = this.__getContentElement();
|
117
|
-
|
117
|
+
const contentRole = content?.tagName === 'D2L-DROPDOWN-MENU' ? 'menu' : 'true';
|
118
|
+
this._setOpenerElementAttribute(content?.opened || false, false, contentRole);
|
118
119
|
}
|
119
120
|
|
120
121
|
updated(changedProperties) {
|
@@ -190,7 +191,7 @@ export const DropdownOpenerMixin = superclass => class extends superclass {
|
|
190
191
|
__getContentElement() {
|
191
192
|
if (!this.shadowRoot) return undefined;
|
192
193
|
return this.shadowRoot.querySelector('slot:not([name])').assignedNodes()
|
193
|
-
.filter(node => node.hasAttribute && node.hasAttribute('dropdown-content'))[0];
|
194
|
+
.filter(node => node.hasAttribute && (node._dropdownContent || node.hasAttribute('dropdown-content')))[0];
|
194
195
|
}
|
195
196
|
|
196
197
|
__onClosed() {
|
@@ -331,11 +332,12 @@ export const DropdownOpenerMixin = superclass => class extends superclass {
|
|
331
332
|
}
|
332
333
|
}
|
333
334
|
|
334
|
-
_setOpenerElementAttribute(val, setActive = false) {
|
335
|
+
_setOpenerElementAttribute(val, setActive = false, hasPopup) {
|
335
336
|
const opener = this.getOpenerElement();
|
336
337
|
if (!opener) return false;
|
337
338
|
const attribute = opener.isButtonMixin ? 'expanded' : 'aria-expanded';
|
338
339
|
opener.setAttribute(attribute, val.toString());
|
340
|
+
if (hasPopup) opener.setAttribute('aria-haspopup', hasPopup);
|
339
341
|
if (setActive) {
|
340
342
|
if (val) opener.setAttribute('active', 'true');
|
341
343
|
else opener.removeAttribute('active');
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@brightspace-ui/core",
|
3
|
-
"version": "3.151.
|
3
|
+
"version": "3.151.5",
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
5
5
|
"type": "module",
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|