question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug & fix: ion-split-pane not allow click in ion-menu (Vue.js)

See original GitHub issue

Bug Report

Ionic version: [x] 4.x

Current behavior: When you use ion-split-pane with ion-menu inside can’t click on elements and click on next layer instead ion-menu layer.

Expected behavior: Element click as expected

Steps to reproduce: Try to use ion-split-pane with ion-menu normally.

Related code:

<ion-split-pane class="indexTopMenu" id="main-content">
      <menu-lateral />
    </ion-split-pane>

MenuLateral.vue:
<template>
  <ion-menu class="menuOptions" type="overlay" side="start" content-id="main-content">
    <ion-content padding>
      /* Insert what you want here as button or anything else */
    </ion-content>
    </ion-menu>
</template>

Other information: How to fix: CSS: .menu-content-open { pointer-events: unset !important; }

If z-index show behind main layer use this option: .menu-content.menu-content-open { z-index: 20; }

Ionic info:

Ionic:

   Ionic CLI       : 5.2.7 (C:\Users\Pablo\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework : @ionic/vue 0.0.9

Vue:
    @ionic/vue: 0.0.9 => 0.0.9

Utility:

   cordova-res : 0.6.0
   native-run  : 0.2.8

System:

   NodeJS : v12.8.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.10.2
   OS     : Windows 10

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
liamdebeasicommented, Oct 23, 2019

@PabloGBarcelo Thanks for the follow up. I took a look at your repo, and it looks like this bug is occurring because you are using ion-split-pane incorrectly. I changed the following things, and the app is now working correctly:

  1. ion-menu-controller does not need content-id.
  2. You need to wrap your main content in a div and assign it the ID main-content.
  3. ion-split-pane needs to have content-id, not id.
  4. Your main content should be inside of the ion-split-pane component.

The new template should look like:

<template>
  <ion-app>
    <ion-menu-controller></ion-menu-controller>

    <ion-split-pane content-id="main-content">
      <ion-menu class="menuOptions" type="overlay" side="start" content-id="main-content">
        <ion-content class="fullWidth" padding>
          <button @click="close">close</button>
        </ion-content>
        <div>footer</div>
      </ion-menu>
      
      <div id="main-content">
        <ion-button @click="openStart">Open Menu</ion-button>
        <list-component></list-component>
      </div>
    </ion-split-pane>    
  </ion-app>
</template>

You will likely need to add width: 100% to your main content as well. For further help implementing your app, I recommend looking at the following resources:

ion-split-pane Documentation Ionic Forums Ionic Slack

I am going to close this issue. Thanks!

2reactions
MachineMakesNoisecommented, Oct 23, 2019

As I suspected I was using menu wrong; checked the side menu example and my issue was caused by a wrong contentId on the menu. So You can disregard my comments related to this, thank you 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug & fix: ion-split-pane not allow click in ion-menu (Vue.js ...
When you use ion-split-pane with ion-menu inside can't click on elements and click on next layer instead ion-menu layer. Expected behavior:
Read more >
Problem with tabs and shared ion-menu - Ionic Vue
Hi, I'm trying to set up a common ion-menu for every tab in a tab-based interface. I've added the same menu to each...
Read more >
Newest 'ion-menu' Questions - Stack Overflow
I am having a bug with IonMenu (Ionic React v5.0.7 + Capacitor 2.2.0)... even when I put "onClick" handlers it aren´t working (not...
Read more >
How to Create an Ionic Side Menu with Accordion Items
Learn to implement and Ionic side menu with accordion component and routing - plus a dynamic way with recursion! Learn Ionic...
Read more >
Ionic Forum - Latest topics - RSSing.com
<ion-split-pane> <ion-menu contentId="sideMenu" type="overlay"> ... move to a tab and trigger ionChange from the base page it give me error.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found