As this property is readonly it causes some interesting problems. In the Xaminals example your selection opens a new page so everytime you search the SelectedItem property is reset. In my app for example, I have the SearchHandler component as a means to search for an item and add it to an ObservableCollection<> within the same view. The problem that arises is that I cannot add the same item twice consecutively. I must first select another item so ItemSelected is reset before going back to add the item I wanted to add for the second time in a row!
For a bit more detail I have a post on the Xamarin Forums https://forums.xamarin.com/discussion/162196/how-to-set-itemselected-to-null-after-selection-xamarin-shell-search-handler#latest
e.g. Cheese selected from dropdown twice, two Cheese items added to list
Cheese selected twice, first time its added. Second time nothing happens (because SelectedItem is still set to Cheese)
Hi @iooovolts, thanks for reporting!
Would it be possible to share this with us in a reproduction project? That way we can easier see what you situation is and hopefully get this resolved quickly.
Thanks!
Here you go @jfversluis . This is a basic app which focuses on the bug I described up above. You should not be able to add an ingredient twice consecutively.
https://github.com/iooovolts/SearchHandlerApp
Find an improved copy of your repro project attached. I have added/changed a couple of things. What I basically did is implement a custom search handler that is more suitable for your needs.
You can see all changes by searching for // GV:.
Unless @PureWeen thinks differently I think this works as intended and I will close this for now. I hope this solution will work for you.
I have tested the solution and it works exactly as expected. Thank you for all your help @jfversluis