Skip to content

error TS2339: Property 'userSelect' does not exist on type 'CSSStyleDeclaration' #13506

Closed
@martinlindhe

Description

@martinlindhe

TypeScript Version: 2.1.5

Code

const el = document.createElement("div");
el.style.userSelect = "none"; // error here, property dont exist

Expected behavior:
since the user-select css property is now unprefixed, it would be good to be able to set it!

Actual behavior:
tsc compile error: error TS2339: Property 'userSelect' does not exist on type 'CSSStyleDeclaration'.

More
According to caniuse.com, unprefixed user-select is available in IE11, Edge, Chrome and Firefox

Metadata

Metadata

Assignees

Labels

Domain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do thisSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions