Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

282
Vistas
How to stoPropagation in ion-tab from IONIC 3

I have an app with 4 ion-tabs like example below:

enter image description here

I would like that in some cases disable the ion-tab and if user try click in this disabled tabs the application will display a modal message for them. As we already know, if we disable an "ion-tab: or a "button" we cannot get the eventLister. So I'm trying to get this click event and stopPropagation() but it`s not working. Could you please help me?

take a look my code

#My ion-tabs

<ion-tabs #myTabs *ngIf="showTabs">
   <ion-tab *ngFor="let tab of tabs" [root]="tab.root" [tabTitle]="tab.title" [tabIcon]="tab.icon"
(ionSelect)="selectPage($event)" (ionChange)=selectedTab($event)></ion-tab>

#in my .ts file I tried this I get all tabs element and put a css style to simulate disabled adding a class ''.isDisabled'

const tabs = document.querySelectorAll('.tab-button');

for (let i = 1; i < tabs.length; i++) {
   tabs[i].classList.add('isDisabled');
}

here I'm trying get the tab element in position 1 and get the eventLister

tabs[1].addEventListener('click', function (e) {
  e.stopPropagation();
  alert('teste');
});

I can get this eventListener but the e.stopPropagation() is not working.

any suggestion to help me? thanks. ;)

$css

  .isDisabled {
  cursor: not-allowed;
  position: relative;
  opacity: 0.5;
  text-decoration: none;
  //pointer-events: none;
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda