Skip to content

Add more precise typing for autoComplete HTML attribute #52169

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
wants to merge 1 commit into from
Closed

Add more precise typing for autoComplete HTML attribute #52169

wants to merge 1 commit into from

Conversation

yanndinendal
Copy link

@yanndinendal yanndinendal commented Jan 9, 2023

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

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

autoComplete autocompletion in vscode

The 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).

I can also add a description above the autoComplete line, something like that:

    /** See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
     * and https://html.spec.whatwg.org/multipage/forms.html#autofill
     * for more information and examples. */

and I can even add MDN's descriptions above each value, as they are really well explained and some of them may not always be intuitive at first glance. I didn't add them for now, as it looks like the list is kept quite compact.

Please tell me if I need to make any changes or improvements.

Fixes #52168

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

blob:vector://vector/f78d41f4-76af-4c04-b3e2-6c594d97f3e2

The 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).

I can also add a description above the `autoComplete` line, something like that:

```ts
    /** See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
     * and https://html.spec.whatwg.org/multipage/forms.html#autofill
     * for more information and examples. */
```

and I can even add [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values)'s descriptions above each value, as they are really well explained and some of them may not always be intuitive at first glance. I didn't add them for now, as it looks like the list is kept quite compact.

Please tell me if I need to make any changes or improvements.
@typescript-bot
Copy link
Collaborator

It looks like you've sent a pull request to update our 'lib' files. These files aren't meant to be edited by hand, as they consist of last-known good states of the compiler and are generated from 'src/lib' or possibly our lib generator. Unless this is necessary, consider closing the pull request and sending a separate PR to update 'src/lib' or https://github.com/microsoft/TypeScript-DOM-lib-generator

@typescript-bot typescript-bot added lib update PR modifies files in the `lib` folder For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jan 9, 2023
@typescript-bot
Copy link
Collaborator

It looks like you've sent a pull request to update some generated declaration files related to the DOM. These files aren't meant to be edited by hand, as they are synchronized with files in the TSJS-lib-generator repository. You can read more here. For house-keeping purposes, this pull request will be closed.

yanndinendal added a commit to yanndinendal/TypeScript-DOM-lib-generator that referenced this pull request Jan 9, 2023
 Replaces: microsoft/TypeScript#52169

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

![autoComplete autocomplete in vscode](https://user-images.githubusercontent.com/58247/211378145-c01c665b-9f4b-4918-83cc-16532f555935.png)

The 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).
@yanndinendal
Copy link
Author

Replaced with: microsoft/TypeScript-DOM-lib-generator#1467

yanndinendal added a commit to yanndinendal/TypeScript-DOM-lib-generator that referenced this pull request Mar 21, 2023
 Replaces: microsoft/TypeScript#52169

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

![autoComplete autocomplete in vscode](https://user-images.githubusercontent.com/58247/211378145-c01c665b-9f4b-4918-83cc-16532f555935.png)

The 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).
yanndinendal added a commit to yanndinendal/TypeScript-DOM-lib-generator that referenced this pull request Mar 21, 2023
Replaces: microsoft/TypeScript#52169

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

![autoComplete autocomplete in vscode](https://user-images.githubusercontent.com/58247/211378145-c01c665b-9f4b-4918-83cc-16532f555935.png)

The 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).
yanndinendal added a commit to yanndinendal/TypeScript-DOM-lib-generator that referenced this pull request Jun 19, 2023
Replaces: microsoft/TypeScript#52169

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

![autoComplete autocomplete in vscode](https://user-images.githubusercontent.com/58247/211378145-c01c665b-9f4b-4918-83cc-16532f555935.png)

The 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug lib update PR modifies files in the `lib` folder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve HTML autocomplete attribute
2 participants