-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
PageTitle doesn't display for SSR pages in mixed render mode app #50268
Comments
Upon investigating it further... This seems to be connected to the enhanced navigation and DOM preservation in the case of SSR. The When you do a full navigation to the page the title is correct initially. Then it switches to |
Yeah, this seems like another example of #49613 rearing its head again. I think we should aim for a fundamental fix for this that doesn't require any extra APIs or annotations. |
@marinasundstrom @MackinnonBuck Are you sure this has something to do with DOM preservation or enhanced nav? I don't think it does, since the same issue will still occur even if you disable those via: Blazor.start({
ssr: { disableDomPreservation: true }
}); Instead, I think what happens is:
So really I think this is an issue with interactive |
@SteveSandersonMS You are right. I was further looking into it and DOM preservation doesn't explain it. The problem is that the Doing a complete navigation hints about this. |
I've looked into this a bit more. However, note that all interactive components immediately replace their prerendered content. If the For now, we would recommend that |
Thanks for contacting us. We're moving this issue to the |
@MackinnonBuck Ok. I’ll have to find a workaround then. My case was a product listing page. I wanted to title to reflect the state of the interactive component. I can probably set the title from JavaScript. |
Thanks for contacting us. We're moving this issue to the |
When addressing this issue, we should also consider the case where the |
Closing as a dupe of #51132 |
I'm reopening this issue because I don't think it's best understood as a duplicate of #51132 My reasoning is that there might not be a completely general solution for #51132 since not all possible section usage will even make sense in a mixed rendermode scenario. And it's potentially complex enough that it would be expensive to address to any extent. But just finding a standalone solution for PageTitle may be much more practical. If this is the main thing that's causing trouble for people, there's a good argument for addressing this limitation on its own. |
@dotnet/aspnet-blazor-eng I've removed loads of labels, milestone, etc. so this goes back into triage. |
Parking this in the same milestone as #51132. Let's see if we can actually solve the more general problem tracked by that issue, and if not, then try to solve the PageTitle case as a special one. |
fwiw, I just started working LocalProtectedStorage so I was using this render mode and reading the store in OnIntializedAsync. @rendermode @(new InteractiveServerRenderMode(prerender: false)) So I changed the rendermode to InteractiveServer and used OnAfterRenderAsync/FirstRender to read the store; PageTitle now works. |
Is there an existing issue for this?
Describe the bug
Info: Investigation shows that this is related to enhanced navigation and DOM preservation. See comment.
I have a Blazor Server app with mixed render modes, SSR and WebAssembly (Auto). Some pages are server-rendered, and a couple of them have dynamic components (WebAssembly Auto) that set the title depending on content.
In
App.razor
, I have added render mode to theHeadOutlet
:Upon navigating to to a page,
PageTitle
is then only updated/rendered for the pages with dynamic components setting them, but not the server-side rendered pages.They instead default to their address:
The
<title>
element is not even rendered in<head></head>
.Expected Behavior
That PageTitle works in components of all modes a in mixed render mode app.
Even if
HeadOutlet
has the@rendermode="@RenderMode.Auto"
thePageTitle
of SSR pages should be rendered.Steps To Reproduce
App.razor
:PageTitle
.Exceptions (if any)
No response
.NET Version
8.0.100-rc.2.23421.3
Anything else?
No response
The text was updated successfully, but these errors were encountered: