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

fix: Double click needed for expanding/collapsing child elements in FluentNavGroup when prerendering is turned off #2097

Closed
emetrix opened this issue May 25, 2024 · 5 comments · Fixed by #2133
Labels
needs: repro code or repository The provided description or code is insufficient to repro the issue

Comments

@emetrix
Copy link

emetrix commented May 25, 2024

🐛 Bug Report

In a Blazor SSR project with PreRendering turned off when I first click on a FluentNavGroup Expand Icon the subitems are expanded or collapsed as they should.
But when I then click on the FluentNavGroup Title Text a short flickering occurs and the subitems are not expanded nor collapsed.
The displaying or hiding of the subitems occurs correctly when I click on the Title a second time.

💻 Repro or Code Sample

Turn off prerendering for HeadOutlet and Routes:

@rendermode="new InteractiveServerRenderMode(prerender: false)

  1. Click the expand icon
    image

  2. Child items are expanded
    image

  3. Click the Title Text
    image

  4. A flickering occurs but child item are NOT being collapsed
    image

  5. Click the Title Text a second time
    image

  6. Now the child items are collapsed
    image

This also happens vice versa: When I collapse sub items by the expand icon two clicks on the title text are neccessary to expand the sub items again...

When Blazor Server pre-rendering is turned on it works as expected. But due to different circumstances I can't/don't want to use pre-rendering in my project.

🤔 Expected Behavior

Expanding / Collapsing child items should be done with one click.

😯 Current Behavior

see bug description

💁 Possible Solution

🔦 Context

🌍 Your Environment

  • OS & Device: Windows 11 on PC
  • Browser Microsoft Edge
  • .NET 8.0.4 and Fluent UI Blazor library Version 4.7.2
@microsoft-github-policy-service microsoft-github-policy-service bot added the triage New issue. Needs to be looked at label May 25, 2024
@vnbaaij
Copy link
Collaborator

vnbaaij commented May 31, 2024

I can't reproduce it. Please supply a ready-to-run repo sample or more refined steps on how to reproduce.

For reproducing, I created a new project based on our template with interactivity render mode=server and interactivity location set to global. I added the rendermode change you supplied and added a group with items to the nav menu.

@vnbaaij vnbaaij added needs: repro code or repository The provided description or code is insufficient to repro the issue and removed triage New issue. Needs to be looked at labels May 31, 2024
@emetrix
Copy link
Author

emetrix commented May 31, 2024

Thank you Vincent, please see the sample "https://github.com/emetrix/Samples.BlazorFluentUI-FluentNavGroup". As far as I remember I only modified the files App.razor (for rendermode) and NavMenu.razor (for adding FluentNavGroup with subitems).

I hope that makes it possible to reproduce the issue. Otherwise please let me know...

@vnbaaij
Copy link
Collaborator

vnbaaij commented Jun 28, 2024

We are reverting this fix for the next release (4.9.0) as there are too many unwanted side effects.

As explained in the PR mentioned above, this issue can still easily be resolved by setting the Data parameter of the FluentNavMenu component to a non-null value:

 Data="@("no-pagescript")

vnbaaij added a commit that referenced this issue Jun 28, 2024
* [NavMenu] Revert fix for #2097. Needsa different/better solution
* [Demo] Make NavGroup.Expanded bindable
@emetrix
Copy link
Author

emetrix commented Jul 3, 2024

Hi Vincent, do you think a fix will be possible in one of the next releases or is the mentioned workaround a permanent one ?

@vnbaaij
Copy link
Collaborator

vnbaaij commented Jul 3, 2024

I'm guessing the workaround will be permanent.

There are not that many cases where prerendering is being used while the effort we need to take to solve this in a good and solid way is pretty high.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: repro code or repository The provided description or code is insufficient to repro the issue
Projects
None yet
2 participants