Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fiznool opened this issue Oct 13, 2016 · 4 comments · Fixed by microsoft/TypeScript-DOM-lib-generator#160
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this

Comments

@fiznool
Copy link

fiznool commented Oct 13, 2016

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';
@mhegazy mhegazy added Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this labels Oct 13, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Oct 13, 2016

PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes.

@mhegazy mhegazy added this to the Community milestone Oct 13, 2016
@fiznool
Copy link
Author

fiznool commented Oct 13, 2016 via email

@mhegazy
Copy link
Contributor

mhegazy commented Oct 13, 2016

The issue is up for grabs. Any interested member can pick it up. But I would say be the PR you want to see in the world ;)

@alisabzevari
Copy link
Contributor

I will fix it. It should be easy. Just adding the missing type to the related json file in https://github.com/Microsoft/TSJS-lib-generator project.

@mhegazy mhegazy modified the milestones: TypeScript 2.1, Community Oct 17, 2016
@mhegazy mhegazy reopened this Oct 17, 2016
@mhegazy mhegazy added Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet and removed Fixed in TSJS repo labels Oct 21, 2016
@mhegazy mhegazy modified the milestones: TypeScript 2.1, TypeScript 2.1.2 Oct 27, 2016
@mhegazy mhegazy added Fixed A PR has been merged for this issue and removed Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet labels Oct 31, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants