Skip to content

Wrong idention in razor on Enter #12705

@MarvinKlein1508

Description

@MarvinKlein1508

@davidwengier

VS Insiders [11415.281]

Before:

<FluentGrid>
	<FluentGridItem xs="8" sm="4">

		<EditForm Model="Input" method="post" OnValidSubmit="HandleLogin" FormName="login">
			<DataAnnotationsValidator />
			<h2>Use a local account to log in.</h2>
			<hr />
			<ValidationSummary class="text-danger" role="alert" />
			<FluentStack Orientation="Orientation.Vertical">
				<FluentTextInput Name="Input.Username" @bind-Value="Input.Username" AutoComplete="username" Required="true" Label="Username" Style="width: 100%" />
				<ValidationMessage For="() => Input.Username" class="text-danger" />

				<FluentTextInput type="password" Name="Input.Password" @bind-Value="Input.Password" AutoComplete="current-password" Required="true" Placeholder="password" Label="Password" Style="width: 100%" />
				<ValidationMessage For="() => Input.Password" class="text-danger" />

				<FluentSwitch Name="Input.UseLdap" @bind-Value="Input.UseLdap" Label="Verwende Active Directory" />
				<FluentCheckbox Name="Input.RememberMe" @bind-Value="Input.RememberMe" Label="Angemeldet bleiben" />
				<InputCheckbox @bind-Value="Input.RememberMe" />
				<FluentButton Type="ButtonType.Submit" Style="width: 100%">Log in</FluentButton>
			</FluentStack>
		</EditForm>
	</FluentGridItem>
</FluentGrid>

After I hit enter before FluentSwitch:

<FluentGrid>
	<FluentGridItem xs="8" sm="4">

		<EditForm Model="Input" method="post" OnValidSubmit="HandleLogin" FormName="login">
			<DataAnnotationsValidator />
			<h2>Use a local account to log in.</h2>
			<hr />
			<ValidationSummary class="text-danger" role="alert" />
			<FluentStack Orientation="Orientation.Vertical">
				<FluentTextInput Name="Input.Username" @bind-Value="Input.Username" AutoComplete="username" Required="true" Label="Username" Style="width: 100%" />
				<ValidationMessage For="() => Input.Username" class="text-danger" />

				<FluentTextInput type="password" Name="Input.Password" @bind-Value="Input.Password" AutoComplete="current-password" Required="true" Placeholder="password" Label="Password" Style="width: 100%" />
				<ValidationMessage For="() => Input.Password" class="text-danger" />


					<FluentSwitch Name="Input.UseLdap" @bind-Value="Input.UseLdap" Label="Verwende Active Directory" />
				<FluentCheckbox Name="Input.RememberMe" @bind-Value="Input.RememberMe" Label="Angemeldet bleiben" />
				<InputCheckbox @bind-Value="Input.RememberMe" />
				<FluentButton Type="ButtonType.Submit" Style="width: 100%">Log in</FluentButton>
			</FluentStack>
		</EditForm>
	</FluentGridItem>
</FluentGrid>

Expected result:

<FluentGrid>
	<FluentGridItem xs="8" sm="4">

		<EditForm Model="Input" method="post" OnValidSubmit="HandleLogin" FormName="login">
			<DataAnnotationsValidator />
			<h2>Use a local account to log in.</h2>
			<hr />
			<ValidationSummary class="text-danger" role="alert" />
			<FluentStack Orientation="Orientation.Vertical">
				<FluentTextInput Name="Input.Username" @bind-Value="Input.Username" AutoComplete="username" Required="true" Label="Username" Style="width: 100%" />
				<ValidationMessage For="() => Input.Username" class="text-danger" />

				<FluentTextInput type="password" Name="Input.Password" @bind-Value="Input.Password" AutoComplete="current-password" Required="true" Placeholder="password" Label="Password" Style="width: 100%" />
				<ValidationMessage For="() => Input.Password" class="text-danger" />


				<FluentSwitch Name="Input.UseLdap" @bind-Value="Input.UseLdap" Label="Verwende Active Directory" />
				<FluentCheckbox Name="Input.RememberMe" @bind-Value="Input.RememberMe" Label="Angemeldet bleiben" />
				<InputCheckbox @bind-Value="Input.RememberMe" />
				<FluentButton Type="ButtonType.Submit" Style="width: 100%">Log in</FluentButton>
			</FluentStack>
		</EditForm>
	</FluentGridItem>
</FluentGrid>

Note: using format document corrects the wrong format.

Here is a GIF version:

Image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions