ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: menuInnerEl is undefined in menu when routing back a page

Open KANekT opened this issue 2 years ago • 16 comments

Prerequisites

Ionic Framework Version

  • [ ] v4.x
  • [ ] v5.x
  • [X] v6.x

Current Behavior

"@ionic/vue": "^6.0.10",

ion-menu.js not sync with core

Expected Behavior

in "@ionic/vue": "6.0.10" image const width = this.menuInnerEl.offsetWidth;

in code https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/menu/menu.tsx#L406 const width = this.menuInnerEl!.offsetWidth; - with !

Steps to Reproduce

npm install go to ..\node_modules@ionic\core\components\ion-menu.js

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.18.1 (C:\Users\KANekT\AppData\Roaming\npm\node_modules@ionic\cli) Ionic Framework : @ionic/vue 6.0.10

Capacitor:

Capacitor CLI : 3.4.3 @capacitor/android : 3.4.3 @capacitor/core : 3.4.3 @capacitor/ios : 3.4.3

Utility:

cordova-res : not installed globally native-run : 1.5.0

System:

NodeJS : v16.13.0 (C:\Program Files\nodejs\node.exe) npm : 8.1.4 OS : Windows 10

Additional Information

No response

KANekT avatar Mar 09 '22 08:03 KANekT

await this.loadAnimation(); why it exec loadAnimation if animated = false ?

KANekT avatar Mar 09 '22 11:03 KANekT

Thanks for the issue. Can you please describe the problem you are running into?

liamdebeasi avatar Mar 09 '22 14:03 liamdebeasi

@liamdebeasi

i have ion-menu on page

then i go to another page where there is no menu

then i go back

ion-menu not work - in console "this.menuInnerEl.offsetWidth is undefined"

KANekT avatar Mar 10 '22 05:03 KANekT

Can you please provide a GitHub repo I can use to verify this behavior?

liamdebeasi avatar Mar 10 '22 13:03 liamdebeasi

@liamdebeasi https://github.com/KANekT/ion-menu-bug

KANekT avatar Mar 11 '22 06:03 KANekT

image

KANekT avatar Mar 11 '22 06:03 KANekT

@liamdebeasi Same Problem with Angular. Should i create a sample repo or can you reproduce?

danielehrhardt avatar Apr 19 '22 14:04 danielehrhardt

I can reproduce the issue, thanks!

liamdebeasi avatar Apr 19 '22 14:04 liamdebeasi

@liamdebeasi you have any plan to fixed this Error ?

KANekT avatar Apr 22 '22 16:04 KANekT

Is this being worked on? Is there a timeframe for the patch? This has been 3 months and is a major bug that breaks the menu. Its issues like these, that make me want to move on from ionic.

nodiced922 avatar Jun 12 '22 16:06 nodiced922

Any work arounds?

nodiced922 avatar Jun 12 '22 16:06 nodiced922

Any work arounds?

<ion-menu
      [disabled]="true"
       menuId="main"

app.component.ts:

ngAfterViewInit() {
       this.menuCtrl.enable(true, "main");
}

danielehrhardt avatar Jun 12 '22 16:06 danielehrhardt

Same problem, any solutions?

ErnestoArtime avatar Jun 21 '22 13:06 ErnestoArtime

I had previously been Including my header which contained my menu on each page. I moved this to a single Instance up to my app component and I haven't had an issue with any bugs. I did have to rewire some events, etc triggered by the header, but it was worth the small amount of work to make this change

nodiced922 avatar Jun 21 '22 13:06 nodiced922

i use hack in minify files after build vue-tsc --noEmit && vite build: find

    vs(!this.isAnimating,"can not be animating")

& replace

    this.isAnimating&&document.location.reload()

find loadAnimation() & add

typeof this.menuInnerEl=="undefined"&&document.location.reload();

and then use npx cap sync

KANekT avatar Jun 23 '22 13:06 KANekT

@liamdebeasi you planed or not fixed this bug ?

6 month ago it confirmed

KANekT avatar Sep 15 '22 17:09 KANekT

Hi, I'm facing the same problem, any solution?

YuriZem avatar Nov 08 '22 11:11 YuriZem

Same bug here!

dbertolini avatar Nov 23 '22 00:11 dbertolini

Seeing the same bug on my app. The app got frozen with the first interaction after/while loading Does it seem it is the same bug reported in 2019?! https://github.com/ionic-team/ionic-framework/issues/17948

massitashakori avatar Dec 12 '22 01:12 massitashakori

is there any progress on this one ? seems kind of absurd not to fix this one

StavM avatar Mar 30 '23 12:03 StavM

we must suffer and be in pain :)

KANekT avatar Apr 07 '23 09:04 KANekT

Can everyone try the following dev build and let me know if it resolves the issue?

Angular

npm install @ionic/[email protected]

React

npm install @ionic/[email protected] @ionic/[email protected]

Vue

npm install @ionic/[email protected] @ionic/[email protected]

liamdebeasi avatar Apr 07 '23 16:04 liamdebeasi

how I can use this on v6 ?

KANekT avatar Apr 07 '23 17:04 KANekT

Normally we don't release bug fixes to previous major versions of Ionic, but this is a high impact bug so I'd like to backport this patch to v6.

Here is a v6 dev build you can try: 6.7.3-dev.11680889549.1f830ade

liamdebeasi avatar Apr 07 '23 17:04 liamdebeasi

@liamdebeasi yes it fixed error in may application on v6, thanks

KANekT avatar Apr 08 '23 03:04 KANekT

Thanks for the issue. This has been resolved via https://github.com/ionic-team/ionic-framework/pull/27141, and a fix will be available in an upcoming release of Ionic Framework.

liamdebeasi avatar Apr 10 '23 19:04 liamdebeasi

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[bot] avatar May 10 '23 19:05 ionitron-bot[bot]