Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ The following example shows how to customize the items:

See a similar example on the [FluentSelect](/List/Select#customize-the-items) page.

## Placeholders and autofill

{{ INCLUDE PlaceholderAutofill }}

## API FluentCombobox

{{ API Type=FluentCombobox<string,string> }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,12 @@ You cannot modify them dynamically.

You can set the `TextInputType` property to define the type of the text input. This relies on browser supplied support for the different types and can therefore vary between browsers.


{{ TextInputTypes }}

## Placeholders and autofill

{{ INCLUDE PlaceholderAutofill }}

## API FluentTextInput

{{ API Type=FluentTextInput }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The `Placeholder` parameter is used to set the placeholder text for the input field. This is a short hint that describes the expected value of the input field.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked to Copilot and his answer is here. So, do we need to explain the default HTML behaviors? To discuss.


The behavior you describe applies to native HTML elements as well.
Browsers use heuristics to decide when to show autofill suggestions, and those heuristics are not limited to autocomplete. Placeholder text is one of the signals that can influence autofill.

  • placeholder text can influence autofill
  • autocomplete="off" is not reliable
  • Avoid semantic placeholder values if autofill is undesired
  • Disabling autofill requires browser-level user settings, not HTML

Source:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. No need to explain that here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's good to have as this can save us some issues getting raised. I remember that we spent quite some time on figuring this one out.

See #3899 even javiercn had to do some research on this dotnet/aspnetcore#62296

Having it in the docs also means we have this details in the MCP server :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not opposed to adding this information to clarify things for certain developers. My only other suggestion, then, is to place the PlaceholderAutofill.md file in the TextInput folder, which is more appropriate, to avoid putting it in the root of Components. And rename it to ChapterPlaceholderAutofill.md or SectionPlaceholderAutofill.md to clarify this is not a page.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I placed it on the root as the same concept applies for FluentCombobox and FluentAutocomplete. What if we add a Shared folder in the root which holds this kind of docs.

It is displayed when the input field is empty and not focused.

The placeholder value affects the autofill suggestion feature in Microsoft Edge and Google Chrome.
Even if you set the `AutoComplete` parameter to `off`, the browser may still display autofill suggestions based on the placeholder value.

There are certain placeholder values which you should avoid to prevent the browser from showing autofill suggestions.

| Value (Placeholder/Name) | Description |
|--------------------------|--------------------------------------|
| `name`, `full name`, `first name`, `last name`| Personal name fields |
| `email`, `e-mail`, `mail`| Email address fields |
| `address`, `street`, `city`, `zip`, `postal`| Address and postal code fields |
| `phone`, `tel`| Phone number fields |
| `username`, `user`, `login`| Username or login fields |
| `password`, `pwd`| Password fields |
| `dob`, `birthdate`, `date of birth`| Date of birth fields |
| `cc`, `card number`, `credit card`| Credit card fields |

If you still want to use these placeholder values, then you need to disable autofill in your browser settings completely.
Loading