dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.98k stars 1.71k forks source link

[iOS] IndicatorView IndicatorSize Overwritten to Default After Updating ObservableCollection in CarouselView #23508

Closed npostma closed 1 month ago

npostma commented 1 month ago

Description

In a .NET MAUI application, when using a CarouselView with an associated IndicatorView, the IndicatorSize property of the IndicatorView is being reset to its default value after the observable collection bound to the CarouselView is updated.

Actual Behavior: The IndicatorSize property of the IndicatorView is reset to its default value after the ObservableCollection is updated. If updated with e.g. hotreload it goes back to the set value. But after chaning the collection, the indicators are changed to the default size

Steps to Reproduce

Create a .NET MAUI project with a CarouselView and an IndicatorView. (I have it in a grid. Row 0 Col 0 is the carousel, Row 1 Col 0 is the indicatorview) Bind the CarouselView to an ObservableCollection. Set the IndicatorSize property of the IndicatorView to a custom value. Update the ObservableCollection (e.g., add or remove an item). Expected Behavior: The IndicatorSize property of the IndicatorView should retain its custom value after the ObservableCollection is updated.

<IndicatorView 
    Grid.Row="1"
    x:Name="carouselViewIndicator" 
    SelectedIndicatorColor="{StaticResource PrimaryBackground}" 
    IndicatorColor="{StaticResource PrimaryBackgroundAccent}" 
    IndicatorSize="8" 
    Margin="0,0,0,0" 
    HorizontalOptions="FillAndExpand"
    VerticalOptions="FillAndExpand"
    BackgroundColor="Transparent"
    ZIndex="5"
/>

Link to public reproduction project repository

No response

Version with bug

8.0.70 SR7

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 14 and up for sure

Did you find any workaround?

No, tried a lot of things. Setting hights, adding containers to restrict. Nothing seems to help.

Relevant log output

No response

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

npostma commented 1 month ago

It is still an issue..... code for the IndicatorView is posted in the original post.

dotnet-policy-service[bot] commented 1 month ago

Hi @npostma. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

PureWeen commented 1 month ago

Can you push a reproduction to github?

dotnet-policy-service[bot] commented 1 month ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback to reproduce the issue but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.