Skip to content

Improve HTML autocomplete attribute #52168

@yanndinendal

Description

@yanndinendal

Suggestion

🔍 Search Terms

autoComplete html attribute DOM jsx typing completion input password on off precise specific list

✅ Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

Add more precise typing for autoComplete HTML attribute instead of just string.

📃 Motivating Example

This will allow to autocomplete… the autoComplete attribute in vscode for example.

💻 Use Cases

The DOM's autocomplete list is quite long and it's not easy remembering the spelling of each one of them (first_name or given-name? password or current-password?), and it would improve the UX of sites if they were more appropriately used (for example, some people may think that the input's type and/or name attributes may be enough for fields like email or password, but knowing to use autoComplete="new-password" or one-time-code can be really useful).

PR incoming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions