Skip to content

Narrow HTMLElement autocapitalize to supported keywords - #64329

Draft
Ryan Cavanaugh (RyanCavanaugh) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-autocapitalize-type
Draft

Ryan Cavanaugh (RyanCavanaugh) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-autocapitalize-type

Conversation

Copilot AI commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

HTMLElement.autocapitalize was typed as string, allowing misspelled keywords and preventing custom elements from declaring the platform-defined union.

  • DOM declarations

    • Narrow autocapitalize to "off" | "none" | "on" | "sentences" | "words" | "characters".
  • Regression coverage

    • Verify all supported keywords are accepted.
    • Verify misspellings such as "character" are rejected.
declare const element: HTMLElement;

element.autocapitalize = "characters"; // accepted
element.autocapitalize = "character";  // error

@typescript-automation typescript-automation Bot added For Milestone Bug PRs that fix a bug with a specific milestone labels Sep 19, 2026
Copilot AI linked an issue Sep 19, 2026 that may be closed by this pull request
@typescript-automation typescript-automation Bot added For Uncommitted Bug PR for untriaged, rejected, closed or missing bug and removed For Milestone Bug PRs that fix a bug with a specific milestone labels Sep 19, 2026
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix autocapitalize type in lib/dom.d.ts Narrow HTMLElement autocapitalize to supported keywords Sep 19, 2026
@jakebailey

Copy link
Copy Markdown
Member

This is a generated file

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

autocapitalize type is incorrect according to MDN

3 participants