`autocapitalize` type is incorrect according to MDN
#54 372 ouverte le 24 mai 2023
Métriques du dépôt
- Stars
- (48 455 stars)
- Métriques de merge PR
- (Merge moyen 6j 17h) (9 PRs mergées en 30 j)
Description
lib Update Request
In lib/dom.d.ts
https://github.com/microsoft/TypeScript/blob/main/src/lib/dom.generated.d.ts#L9992
the type for HTMLElement.autocapitalize is incorrectly typed as string. According to the MDN article, the autocapitalize attribute/property can only be set to certain keywords.
Therefore, the internal lib dom type should be:
autocapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
Sample Code
This issue affects proper typing in web components that extend HTMLElement that attempt to correctly type autocapitalize. TS errors because string and a union type are not compatible. Every reference to a web component class extending HTMLElement with a proper type for autocapitalize errors incorrectly.