react-spectrum
react-spectrum copied to clipboard
Menu key.currentKey undefined when deselecting
🐛 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