Skip to content

Component rendering/positioning problem in the new blazor web application template #49387

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

Closed
1 task done
bub-bl opened this issue Jul 13, 2023 · 2 comments
Closed
1 task done
Assignees
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-full-stack-web-ui Full stack web UI with Blazor
Milestone

Comments

@bub-bl
Copy link

bub-bl commented Jul 13, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

The problem is related to component rendering in blazor preview 6 with the new template project (blazor web application).

A blink effect is visible when the component is rendered and the component has a positioning problem.
The second Counter component is moved at the top of <h1>Hello, world!</h1>

Expected Behavior

Both components should be rendered below the text "Welcome to your new app."

Steps To Reproduce

<button type="button" @onclick="IncrementCount">Current count: @_currentCount</button>

@code {

    int _currentCount = 0;

    [Parameter]
    public int IncrementAmount { get; set; } = 1;

    void IncrementCount()
    {
        _currentCount += IncrementAmount;
    }

}
  • In the Index.razor, insert the following code:
@page "/"

<PageTitle>Index</PageTitle>

<h1>Hello, world!</h1>

Welcome to your new app.

<Counter IncrementAmount="2" @rendermode="@(RenderMode.Server)" />
<Counter IncrementAmount="2" @rendermode="@(RenderMode.Server)" />
  • Build and run the app
  • Browse to /

Exceptions (if any)

No response

.NET Version

8.0.100-preview.6.23330.14

Anything else?

Additional infos

SDK .NET

Version: 8.0.100-preview.6.23330.14
Commit: ba97796b8f

Environnement d'exécution :
OS Name: Windows
OS Version: 10.0.23493
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100-preview.6.23330.14\

.NET workloads installed:
Il n'y a aucune charge de travail installée à afficher.

Host:
Version: 8.0.0-preview.6.23329.7
Architecture: x64
Commit: 5340be2ccc

.NET SDKs installed:
7.0.304 [C:\Program Files\dotnet\sdk]
7.0.400-preview.23330.10 [C:\Program Files\dotnet\sdk]
8.0.100-preview.6.23330.14 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-preview.5.23302.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-preview.6.23329.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-preview.5.23280.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-preview.6.23329.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0-preview.5.23302.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0-preview.6.23329.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Jul 13, 2023
@jinzhao1127
Copy link

This issue same as internal bug https://github.com/aspnet/AspNetCore-ManualTests/issues/2209, the Second Counter component layout is incorrect
image

@mkArtakMSFT mkArtakMSFT added bug This issue describes a behavior which is not expected - a bug. feature-full-stack-web-ui Full stack web UI with Blazor labels Jul 18, 2023
@mkArtakMSFT mkArtakMSFT modified the milestones: 8.0-preview7, 8.0-rc1 Jul 18, 2023
@MackinnonBuck
Copy link
Member

Thanks for the issue report, @bub-bl! This was fixed in #49238

@ghost ghost locked as resolved and limited conversation to collaborators Sep 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-full-stack-web-ui Full stack web UI with Blazor
Projects
None yet
Development

No branches or pull requests

5 participants
@MackinnonBuck @mkArtakMSFT @jinzhao1127 @bub-bl and others