fluentui-blazor icon indicating copy to clipboard operation
fluentui-blazor copied to clipboard

fix: Autocomplete attribute in Register.razor of .Net 8 FluentUI Blazor template are incorrect resulting in autocompletion of wrong information

Open jhogan05 opened this issue 1 year ago • 2 comments

🐛 Bug Report

A number of the Autocomplete attributes in Register.razor of the FluentUI Blazor template (with Individual Logins) are incorrect resulting in auto-completion of the incorrect Personal info

💻 Repro or Code Sample

In Visual Studio select the new "Fluent Blazor Web App" template via Create New Project, and on the second Wizard pane choose Authentication type: "Individual Accounts". Allow the Project be created, then run the Project and click on Register. Click into the email field and see the Auto-completion options offered by your browser.

🤔 Expected Behavior

Should auto-suggest one existing Email address stored by the users Browser

😯 Current Behavior

In Edge and Chrome it is auto-suggesting the users fullname (Firstname Lastname) not the email

💁 Possible Solution

On Line 31 of Register.razor (in the created Web App) the markup reads incorrectly "username"

<FluentTextField Name="Input.Email" @bind-Value="Input.Email" AutoComplete="username" Required="true" Placeholder="[email protected]" Label="Email" Style="width: 100%" />

it should read "email":

<FluentTextField Name="Input.Email" @bind-Value="Input.Email" AutoComplete="email" Required="true" Placeholder="[email protected]" Label="Email" Style="width: 100%" />

Similary on Line 33:

<FluentTextField type="password" Name="Input.Password" @bind-Value="Input.Password" AutoComplete="current-password" Required="true" Placeholder="password" Label="Password" Style="width: 100%" />

AutoComplete by the guidelines should be "new-password" etc.

🔦 Context

List of defined autcomplete attributes:

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values

🌍 Your Environment

  • OS & Device: Windows 10
  • Browser Microsoft Edge, Google Chrome
  • .NET 8.0 and Fluent UI Blazor library Version 4.7.=2

jhogan05 avatar May 07 '24 01:05 jhogan05

Thank you, we will update this in a future release.

But the Template offers modifiable code and, as an example, I don't think it's urgent to update it. You could always create a PR to propose this change, which would help us improve the product. :-)

dvoituron avatar May 07 '24 07:05 dvoituron

As @dvoituron said, we will check this on our side. I copied the templates from the ASP.NET Core repo. Just checked and the user username too. Are you seeing the same with the standard templates?

vnbaaij avatar May 09 '24 16:05 vnbaaij