You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using non-menu-item components as submenu clicking those components shouldn't trigger TypeError
Actual behavior
Using arbitrary components as submenu items and clicking them produces the TypeError: Cannot read properties of undefined (reading 'selectionRoot') in Menu.handlePointerBasedSelection
Screenshots
What browsers are you seeing the problem in?
No response
How can we reproduce this issue?
Go to '...'
Click on '....'
Scroll to '....'
Check console
See error
Sample code that illustrates the problem
This might be fixed by adding ? after menuData, see:
I'm surprised that without a Menu Item that this code is finding a trigger. Can you share what the trigger is so we can understand how it is both el.getAttribute('role') === this.childRole and el.menuData === undefined?
<li class="spectrum-Menu-item" tabindex="0" role="menuitem"><span class="spectrum-Menu-itemLabel"><span>Edit version info</span></span></li>
and leads to:
TypeError: Cannot read properties of undefined (reading 'selectionRoot')
at Menu.handlePointerBasedSelection (chunk-SCU35XXF.js?v=c2a8ef54:347:59)
at Menu.handlePointerup (chunk-SCU35XXF.js?v=c2a8ef54:321:10)
at Menu.nrWrapper (chunk-DTJESBZO.js?v=c2a8ef54:71:21)
Code of conduct
Impacted component(s)
Menu
Expected behavior
When using non-menu-item components as submenu clicking those components shouldn't trigger TypeError
Actual behavior
Using arbitrary components as submenu items and clicking them produces the TypeError:
Cannot read properties of undefined (reading 'selectionRoot') in Menu.handlePointerBasedSelection
Screenshots
What browsers are you seeing the problem in?
No response
How can we reproduce this issue?
Sample code that illustrates the problem
This might be fixed by adding
?
aftermenuData
, see:in
spectrum-web-components/packages/menu/src/Menu.ts
Line 391 in d38bf04
Logs taken while reproducing problem
No response
The text was updated successfully, but these errors were encountered: