Oct 17 2019 02:24 AM
In SPFX, if we create extension ContextMenu / CommandBar using,
content: Build your first ListView Command Set extension
For first time selection of document / item selected row we will get value for event.selectedRows[0].getValueByName("ID")
but, if you deselect the row and select other document / item row then value for event.selectedRows[0].getValueByName("ID") not getting updated and gives previously selected value
Oct 25 2019 06:43 PM
I was able to replicate your issue. I ran into the same issue while I was developing my extension.
If the extension location is at ContextMenu, there seems to be a bug. "onListViewUpdated" event is not firing whenever you selecting and deselecting the items. So the "event" parameter is still holding the old values. Try to move the location to CommandBar.
You might need to update the location element in the following locations
Before
Location="ClientSideExtension.ListViewCommandSet.ContextMenu"
After