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

MudTreeViewItem: annoyingly slow opening time when expand is triggered via check box #8939

Open
1 of 2 tasks
oakad opened this issue May 10, 2024 · 7 comments
Open
1 of 2 tasks

Comments

@oakad
Copy link

oakad commented May 10, 2024

Bug type

Component

Component name

TreeView

What happened?

I have a smallish tree view with mostly 2 levels of nesting. The tree is all custom, relying on "Content"/"ChildContent" fragments explicitly set. There's a quirk: when TreeViewItem checkbox is not selected, TreeViewItem has no children. When checkbox is selected, the children are populated and the TreeViewItem is expanded. Then, toggle button takes over to expand and collapse as usual. When check box is unselected, the branch is collapsed and all children are removed (app semantics requirement).

When checkbox is in selected state, either because user had selected it earlier or because it was populated during OnParametersSet the toggle button works as expected, collapse/expand animation is nice and smooth.

However, if check box is not selected and user selects it, toggle button reacts immediately, turning and DOM is also modified immediately (populating the children is not expensive, verified in debug - few milliseconds), but the expanded TreeViewItem is not shown for exactly one second, creating a very unpleasant effect (I believe, 1 second comes from "mud-collapse-entering" css class).

Expected behavior

When branch is expanded on first checkbox select it should open the same as when toggle button is shown and used.

It is possible I'm using it all wrong, but I could not figure it out any better.

Reproduction link

https://try.mudblazor.com/snippet/mucyYfPYyECQFnSy

Reproduction steps

Open the snippet, hit the check box, observe the annoying delay.

Relevant log output

No response

Version (bug)

6.19.1

Version (working)

No response

What browsers are you seeing the problem on?

Chrome, Safari

On which operating systems are you experiencing the issue?

macOS

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ScarletKuro
Copy link
Member

Hi.

I would suggest to try out the v7 preview2 where the TreeView was rewritten.

@oakad
Copy link
Author

oakad commented May 10, 2024

I have checked out v7 already. My app has a bunch of MudChips and some sticky columns in MudDataFrames. Changes of style in v7 make chips blend into the background and sticky columns content squished together when grid is scrolled horizontally (the grid issue is nothing new, but opaque default style in v6 makes it tolerable).

The most unfortunate situation of "not there, not here". :-)

@ScarletKuro
Copy link
Member

Changes of style in v7 make chips blend into the background and sticky columns content squished together when grid is scrolled horizontally (the grid issue is nothing new, but opaque default style in v6 makes it tolerable).

@danielchalmers @henon, could you both take a look at this?
Perhaps you could also create a PR to address it.

The thing is, the MudBlazor team will no longer be actively working on v6, except for very critical security bugs. v6 is now fully community-supported, and if you have a fix for the issue in the v6 branch, we would be happy to merge it and upload a nuget.

@oakad
Copy link
Author

oakad commented May 10, 2024

Do you happen to have a v7 sandbox handy so I can try if the issue happens there? try.mudblazor.com is v6 by default.

@henon
Copy link
Collaborator

henon commented May 10, 2024

@oakad please just use the preview nuget or run our docs from source. once v7 is stable we'll switch the docs and try.mudblazor.com to v7, not before.

@danielchalmers
Copy link
Contributor

Please ping me again if it's still an issue in v7.0.0-preview2 so I can remember to take a look

@oakad
Copy link
Author

oakad commented May 10, 2024

Upon experimenting, I found out that the following, somewhat unwieldy, arrangement works much better:

https://try.mudblazor.com/snippet/GkGekfbEgTpvGxvp

No opening animation, but at least no delay.

From the look of it, v7 may have the same behaviour: ChildContent going from null to non-null works ok (as exhibited), but non-null ChildContent going from empty to populated triggers the quirk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants