microsoft / microsoft/TypeScript
`autocapitalize` type is incorrect according to MDN
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
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.
Documentation Link
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.