I have a gallery that displays a list of items for users to select and then use separate controls to edit. When they click on an item, it sets a context variable editVis_ to true, which reveals a group of text inputs to change the details of the item. It also reveals a cancel icon that can be used to exit and unselect the item in the gallery. When they edit an item, it patches the new values to the data source. Once they are done editing the item, I would like them to be able to select the cancel icon to reset the gallery with no items selected.
I tried the solutions in this post both by setting the default of the gallery to a context variable defaultSel_ and then adding the line
UpdateContext({defaultSel_: gallery.Selected}); UpdateContext({defaultSel_: {}}); to the cancel icon and setting the default of the gallery to {} and using
Reset(gallery)in the cancel icon.
Both of these solutions work until I patch an update to the source list. Once I patch an update to an item, it is set as the default selection no matter what I do. Even if I set up a separate button with the code above, it still resets to select the last item that was patched. Is there something wrong with my code, or is this a bug with PowerApps?

Report
All responses (
Answers (