-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Incorrect "setSelectionRange()" type declarations #20419
Copy link
Copy link
Closed
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeBugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
Milestone
Metadata
Metadata
Assignees
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeBugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
lib.dom.d.ts currently has two different type declarations for the
setSelectionRange()API forHTMLInputElementandHTMLTextAreaElement.For
HTMLInputElement(permalink):For
HTMLTextAreaElement(permalink):However, both are wrong, if I'm not mistaken. According to MDN, the correct type declaration would be the following:
Note that neither
startnorendare optional. I also added a union of string literal types to type the (optional)directionparameter more precisely.