-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
BugA 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 TypeScriptHelp WantedYou can do thisYou can do this
Milestone
Description
TypeScript Version: 3.6.0-dev.20190717
Search Terms:
selectionDirection HTMLInputElement DOM definition
Code
const el : HTMLTextAreaElement = new HTMLTextAreaElement();
const direction = el.selectionDirection;
el.setSelectionRange(el.selectionStart, el.selectionEnd, direction );Expected behavior:
No error, as el.selectionDirection is definitely a good value for selectionDirection
Actual behavior:
tsc throw an error because el.selectionDirection is of type "string" and el.setSelectionRange only accept "forward" | "backward" | "none"
solution :
HTMLInputElement.selectionDirection should be of type : "forward" | "backward" | "none" instead of type string. in lib.dom.d.ts at line 7332.
Related Issues:
the bug was introduced by the fixing of setSelectionRange as discuted in issue #20419 and PR #20459
Metadata
Metadata
Assignees
Labels
BugA 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 TypeScriptHelp WantedYou can do thisYou can do this