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

[MAC] Expander with visual bug due to animation sizing #1710

Closed
bow-meow opened this issue Jun 2, 2020 · 1 comment · Fixed by #2129
Closed

[MAC] Expander with visual bug due to animation sizing #1710

bow-meow opened this issue Jun 2, 2020 · 1 comment · Fixed by #2129
Labels
Milestone

Comments

@bow-meow
Copy link

bow-meow commented Jun 2, 2020

Expected Behavior

Having an expander set as the content of a panel with no size limitations should just work.
You should be able to expand/collapse the control with no visual errors.

Actual Behavior

Doing the above will cause the header to gain in size once exiting its collapsed state to expanded.

Steps to Reproduce the Problem

I have managed to reproduce this in your test app in the 'ExpanderSection' with only one line of code at the bottom of the ctor

public ExpanderSection()
{
    var expandedCheckBox = new CheckBox { Text = "Expanded" };
    var enabledCheckBox = new CheckBox { Text = "Enabled" };

    var expander = new Expander
    {
    Header = "Test Header",
    Content = new Panel { Size = new Size(200, 200), BackgroundColor = Colors.Blue }
    };

    expandedCheckBox.CheckedBinding.Bind(expander, e => e.Expanded);
    enabledCheckBox.CheckedBinding.Bind(expander, e => e.Enabled);

    LogEvents(expander);

    var expander2 = new Expander
    {
        Header = new StackLayout
    {
        Orientation = Orientation.Horizontal,
        Items = { "Test Expanded with custom header", new TextBox() }
    },
        Expanded = true,
        Content = new Panel { Size = new Size(300, 200), BackgroundColor = Colors.Blue }
    };

    LogEvents(expander2);

    Content = new StackLayout
    {
        Padding = new Padding(10),
        Items =
        {
            new StackLayout 
            {
                Orientation = Orientation.Horizontal,
                Items =
                {
                    expandedCheckBox,
                    enabledCheckBox
                }
            },
            expander,
            expander2
        }
    };

    Content = expander2; <----------this is the only line I added to make this bug happen
}

My Thoughts

I believe this is to do with the animation sizing code in the ExpanderHandler, in the method 'UpdateExpandedState', because when the 'EnableAnimation' is set to false, this visual bug no longer occures. It could be to do with something else though, not totally sure, this is just what I observed ( :

Specifications

  • Version: latest
  • Platform(s): Mac, XamMac
  • Operating System(s): macOS 10.13
@cwensley
Copy link
Member

cwensley commented Jun 3, 2020

Hey @bow-meow, thanks for reporting the issue!

@cwensley cwensley added this to the 2.5.x milestone Jun 3, 2020
cwensley added a commit to cwensley/Eto that referenced this issue Jan 30, 2022
@cwensley cwensley modified the milestones: 2.6.x, 2.6.2 Jan 30, 2022
@cwensley cwensley added the bug label Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants