react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

Menu key.currentKey undefined when deselecting

Open melcherry98 opened this issue 3 years ago • 0 comments

🐛 Bug Report

When deselecting a menu item initially set as selected using defaultSelectedKeys the key.currentKey value is undefined but if you deselect the same item after it is selected manually it returns the correct key.

🤔 Expected Behavior

I would expect key.currentKey value to be the key of the deselected item.

😯 Current Behavior

https://codesandbox.io/s/menu-deselection-currentkey-undefined-2fffrl?file=/src/App.js

repro:

  • deselect any menu item and view the value logged to the console.
Software Version(s)
react-spectrum 3.19.0
Browser chrome
Operating System Mac OS BigSur

🧢 Your Company/Team

Adobe Marketo Engage

melcherry98 avatar Aug 23 '22 20:08 melcherry98