Skip to content

Property 'resize' does not exist on type 'CSSStyleDeclaration' #11589

Closed
microsoft/TypeScript-DOM-lib-generator
#160
@fiznool

Description

@fiznool

TypeScript Version: 2.0.3

Code

const textarea = document.createElement('textarea');
textarea.style.resize = 'none';

Expected behavior:

  • No warning

Actual behavior:

  • Warning: Property 'resize' does not exist on type 'CSSStyleDeclaration'

To workaround this I have created a new interface extending from CSSStyleDeclaration which does the trick for now.

interface CSSStyleDeclarationWithResize extends CSSStyleDeclaration {
  resize: string
}

const textarea = document.createElement('textarea');
const style: CSSStyleDeclarationWithResize = textarea.style as CSSStyleDeclarationWithResize;
style.resize = 'none';

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions