Description
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';