Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndicatorLayout isn't being correctly cleared out when bindable property is set to null #22361

Closed
liufeias opened this issue May 13, 2024 · 4 comments · Fixed by #22382
Closed
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView good first issue Good for newcomers
Milestone

Comments

@liufeias
Copy link

else if (indicatorView.IndicatorLayout == null)
{
(indicatorView.IndicatorLayout as IndicatorStackLayout)?.Remove();
indicatorView.IndicatorLayout = null;
}

Meaningless code found inside the indicatorView.cs file

IndicatorView.IndicatorLayout is already null, still use as to convert to IndicatorStackLayout

@Eilon Eilon added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label May 13, 2024
@PureWeen
Copy link
Member

I don't think the code is meaningless, I think the if statement is wrong

@PureWeen PureWeen changed the title Meaningless code found inside the indicatorView.cs file IndicatorLayout isn't being correctly cleared out when bindable property is set to null May 13, 2024
@PureWeen PureWeen added the good first issue Good for newcomers label May 13, 2024
@PureWeen PureWeen added this to the Backlog milestone May 13, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue May 13, 2024
kubaflo added a commit to kubaflo/maui that referenced this issue May 13, 2024
@drasticactions
Copy link
Contributor

https://github.com/xamarin/Xamarin.Forms/pull/7465/files#diff-058a6dc771a8401a8be8a54fa8c48d741f9cc316244e34ba553dd6508b3354bdR138-R149

This has been here since Xamarin.Forms, unchanged, for five years. I guess no one ever hit it? lol.

@liufeias
Copy link
Author

https://github.com/xamarin/Xamarin.Forms/pull/7465/files#diff-058a6dc771a8401a8be8a54fa8c48d741f9cc316244e34ba553dd6508b3354bdR138-R149

This has been here since Xamarin.Forms, unchanged, for five years. I guess no one ever hit it? lol.

It's really confusing.

@liufeias
Copy link
Author

I don't think the code is meaningless, I think the if statement is wrong

That's true. I've been confused for a long time.

PureWeen pushed a commit that referenced this issue May 14, 2024
* Fix null handling in UpdateIndicatorLayout method (#22361)

* Added a unit test (#22361)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants