@brightspace-ui/core 2.28.4 → 2.28.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.
- package/components/menu/menu.js +5 -3
- package/package.json +1 -1
package/components/menu/menu.js
CHANGED
|
@@ -224,7 +224,7 @@ class Menu extends FocusVisiblePolyfillMixin(ThemeMixin(HierarchicalViewMixin(Li
|
|
|
224
224
|
return this.shadowRoot && this.shadowRoot.querySelector('d2l-menu-item-return');
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
_getMenuItems() {
|
|
227
|
+
async _getMenuItems() {
|
|
228
228
|
const slot = this.shadowRoot && this.shadowRoot.querySelector('slot');
|
|
229
229
|
if (!slot) return;
|
|
230
230
|
const items = slot.assignedNodes({ flatten: true }).filter((node) => node.nodeType === Node.ELEMENT_NODE);
|
|
@@ -233,6 +233,8 @@ class Menu extends FocusVisiblePolyfillMixin(ThemeMixin(HierarchicalViewMixin(Li
|
|
|
233
233
|
if (returnItem) {
|
|
234
234
|
items.unshift(returnItem);
|
|
235
235
|
}
|
|
236
|
+
// Wait for menu items to have their role attribute set
|
|
237
|
+
await Promise.all(items.map(item => item.updateComplete));
|
|
236
238
|
return items.filter((item) => {
|
|
237
239
|
const role = item.getAttribute('role');
|
|
238
240
|
return (role === 'menuitem' || role === 'menuitemcheckbox' || role === 'menuitemradio' || item.tagName === 'D2L-MENU-ITEM-RETURN');
|
|
@@ -328,8 +330,8 @@ class Menu extends FocusVisiblePolyfillMixin(ThemeMixin(HierarchicalViewMixin(Li
|
|
|
328
330
|
}
|
|
329
331
|
|
|
330
332
|
_onMenuItemsChanged() {
|
|
331
|
-
requestAnimationFrame(() => {
|
|
332
|
-
this._items = this._getMenuItems();
|
|
333
|
+
requestAnimationFrame(async() => {
|
|
334
|
+
this._items = await this._getMenuItems();
|
|
333
335
|
this._updateItemAttributes();
|
|
334
336
|
});
|
|
335
337
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.28.
|
|
3
|
+
"version": "2.28.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",
|