-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Picker value cleared when scrolling a CollectionView in iOS #9659
Comments
Probably related to this |
I'm using a bindable stacklayout to work around this issue since I don't have very many items in the list. Performance seems to be fine. |
@jrpickett For smaller numbers of items, using a BindableLayout is an excellent choice. The BindableLayout will create instances of all your templated items, rather than using a pool of recycled items like CollectionView does. (See #9200 (comment) for a more detailed explanation of what CollectionView is doing.) If you find later that you need a larger number of items than BindableLayout can handle, you can add a property in your view model for the Picker's selection and bind the Picker to it. |
Why is this closed? The problem is still not fixed, my picker value gets cleared aswell when scrolling up or down... |
Has anyone found a workaround for this one? I just encountered it deep into a redesign and it's killing me. |
Okay, the BindableLayout worked as an alternative. It's a shame that CollectionView has errors on all the platforms, I'm not sure it's usable for anything very complex at this point. |
It's true. BindableLayout works for this. Sorry that I didn't respond faster.. |
I don't understand why it's closed actually. Any suggections? |
@cmpalmer66 @programmingworld1 @abondarenko This was closed because it's not a bug. As I suggested upthread, you should take a look at the comments for issue 9200 for an explanation of why it's not a bug and how to use the CollectionView/CarouselView with data binding to achieve your goal. |
I'm using binding and the thing is binded property is empty after a scrolling. |
@abondarenko What does your DataTemplate and your Binding look like? Can you post your XAML/code? |
@hartez I am having a problem with this as well in a CarouselView on iOS. we have a picker that get's the SelectedItem cleared when scrolling from the last fragment, the third fragment, to the first, and then back again. The Selected Item is bound to a property using TwoWay binding. Can this be re-opened? |
March 2022 and the problem still occurs, both for IOS and Android |
Unfortunately with CollectionView the error occurs, but it is possible to work around using ListView CachingStrategy="RetainElement" |
Dec. 2023 and the problem persists. |
No progress... Very sad... |
Values selected in a picker are cleared when you scroll down a collection view and then back up. I found the same issue was logged for the ListView: #4250. I altered the sample from issue 4250 to use a CollectionView and I can reproduce the issue.
Steps to Reproduce
Expected Behavior
Picker values should not clear
Actual Behavior
Picker values cleared
Basic Information
Reproduction Link
Picker_CollectionView_Issue.zip
The text was updated successfully, but these errors were encountered: