Open JPfahl opened 6 months ago
Can repro this issue at Android platform on the latest 17.10 Preview 6 (8.0.20&8.0.21), but it won't be reproduced on iOS. If you have any questions about this, please provide us with a sample project to better illustrate the problem.
In iOS the group will collapse but it will never expand again.
Sample Code:
`<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MauiDev.Views.Sample" Title="Sample">
`
`using System.Collections.ObjectModel; using System.ComponentModel; using System.Runtime.CompilerServices;
namespace MauiDev.Views;
public class Item : INotifyPropertyChanged { public string Name { get; set; }
private double size;
public double Size
{
get => size;
set => SetProperty(ref size, value);
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual bool SetProperty<T>(ref T propertyStorage, T value, [CallerMemberName] string propertyName = null)
{
bool result = false;
if (!Equals(propertyStorage, value))
{
propertyStorage = value;
result = true;
InvokePropertyChanged(propertyName);
}
return result;
}
public virtual void InvokePropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this,
new PropertyChangedEventArgs(propertyName));
}
}
public class Group : Collection
public partial class Sample : ContentPage
{
public System.Collections.ObjectModel.ObservableCollection
public Sample()
{
InitializeComponent();
Group group1 = new Group() { Name = "One" };
group1.Add(new Item() { Name = "A", Size =30 });
group1.Add(new Item() { Name = "B", Size = 30 });
group1.Add(new Item() { Name = "C", Size = 30 });
Groups.Add(group1);
Group group2 = new Group() { Name = "Two" };
group2.Add(new Item() { Name = "D", Size = 30 });
group2.Add(new Item() { Name = "E", Size = 30 });
group2.Add(new Item() { Name = "F", Size = 30 });
Groups.Add(group2);
BindingContext = this;
}
}`
I provided a simple example (one page).
Description
I am providing the ability to collapse a group in a collectionview. This works perfectly in windows but in ios and android when the height of the items in the group is changed the space in the collectionview for the group is not adjusted. So you endup with a gap the size of the original group.
Steps to Reproduce
In code set the MaximumHeightRequest of each item in a group to 0.
iOS The group may collapse but it will never expand again.
Android
Windows
Link to public reproduction project repository
No response
Version with bug
8.0.20 SR4
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android
Affected platform versions
No response
Did you find any workaround?
No
Relevant log output
No response