Skip to content

Improve HTML autocomplete attribute #52168

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
5 tasks done
yanndinendal opened this issue Jan 9, 2023 · 3 comments Β· Fixed by microsoft/TypeScript-DOM-lib-generator#1467
Closed
5 tasks done

Improve HTML autocomplete attribute #52168

yanndinendal opened this issue Jan 9, 2023 · 3 comments Β· Fixed by microsoft/TypeScript-DOM-lib-generator#1467
Labels
Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Milestone

Comments

@yanndinendal
Copy link

yanndinendal commented Jan 9, 2023

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.

@yanndinendal
Copy link
Author

@yanndinendal
Copy link
Author

PR updated: https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1467/files

@yanndinendal
Copy link
Author

yanndinendal commented Oct 9, 2023

This was released in TypeScript 5.2 for the HTML autocomplete attribute.

Unfortunately, it doesn't get picked up in JSX autoComplete props. See DefinitelyTyped/DefinitelyTyped#66982.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Projects
None yet
2 participants