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

[Ionic 4] error TS2339: Property 'width' does not exist on type 'HTMLIonMenuElement'. #14794

Closed
peterpeterparker opened this issue Jul 17, 2018 · 4 comments
Assignees

Comments

@peterpeterparker
Copy link
Contributor

Ionic Info

v4.0.0-alpha.9

Support Question

In v3 Menu use to expose a width() method. Didn't found it in v4. Did I miss something or are they still on the roadmap?

Code

 const menu: HTMLIonMenuElement = await this.menuController.get('myMenu');
 menu.width();
@peterpeterparker
Copy link
Contributor Author

In v4.0.0-alpha.12 getWidth is there, could confirm it compiles

I'm not there to test it but looks good

Side note:

In Ionic v3 method's name is width() and in v4 getWidth() just in case someone would land on that in the future

@brandyscarney
Copy link
Member

@manucorporat Can we document the breaking change for the method name?

@peterpeterparker
Copy link
Contributor Author

Ok so I just tested, I probably did something wrong, but I was unable to get the width of the menu thru this exposed function, I always get undefined

But I found I guess a workaround

const menu: HTMLIonMenuElement = await this.menuController.get('myMenu');
console.log(menu.getWidth()); // --> undefined
console.log(menu.clientWidth); // --> the width of the menu

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 1, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants