From 5907566ec23b267167e908c0054f7919140d3fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Rio?= Date: Fri, 21 Nov 2025 17:12:45 +0000 Subject: [PATCH 1/3] feat(Item): Update canActivate logic to consider theme and mode --- core/src/components/item/item.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/components/item/item.tsx b/core/src/components/item/item.tsx index 97459b92add..4b029dd03f6 100644 --- a/core/src/components/item/item.tsx +++ b/core/src/components/item/item.tsx @@ -8,7 +8,7 @@ import { createColorClasses, hostContext, openURL } from '@utils/theme'; import { chevronForward } from 'ionicons/icons'; import { config } from '../../global/config'; -import { getIonTheme } from '../../global/ionic-global'; +import { getIonMode, getIonTheme } from '../../global/ionic-global'; import type { AnimationBuilder, Color, CssClassMap, StyleEventDetail } from '../../interface'; import type { RouterDirection } from '../router/utils/interface'; @@ -246,7 +246,13 @@ export class Item implements ComponentInterface, AnchorInterface, ButtonInterfac } private canActivate(): boolean { - return this.isClickable() || this.hasCover(); + const theme = getIonTheme(this); + const mode = getIonMode(this); + const shouldActivate = this.isClickable() || this.hasCover(); + if (theme !== 'ionic') { + return shouldActivate; + } + return mode === 'md' && shouldActivate; } private isFocusable(): boolean { From dd4865a273fcfde265586a83c34e1c0136e9ac99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Rio?= Date: Fri, 21 Nov 2025 17:13:00 +0000 Subject: [PATCH 2/3] feat(tabButton): Update canActivate logic to consider theme and mode --- core/src/components/tab-button/tab-button.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/src/components/tab-button/tab-button.tsx b/core/src/components/tab-button/tab-button.tsx index e03b8a69e35..5b820323e63 100644 --- a/core/src/components/tab-button/tab-button.tsx +++ b/core/src/components/tab-button/tab-button.tsx @@ -5,7 +5,7 @@ import type { Attributes } from '@utils/helpers'; import { inheritAttributes } from '@utils/helpers'; import { config } from '../../global/config'; -import { getIonTheme } from '../../global/ionic-global'; +import { getIonMode, getIonTheme } from '../../global/ionic-global'; import type { TabBarChangedEventDetail, TabButtonClickEventDetail, @@ -163,10 +163,20 @@ export class TabButton implements ComponentInterface, AnchorInterface { this.selectTab(ev); }; + private canActivate(): boolean { + const theme = getIonTheme(this); + const mode = getIonMode(this); + if (theme !== 'ionic') { + return true; + } + return mode === 'md'; +} + render() { const { disabled, hasIcon, hasLabel, href, rel, target, layout, selected, tab, inheritedAttributes } = this; const theme = getIonTheme(this); const shape = this.getShape(); + const canActivate = this.canActivate(); const attrs = { download: this.download, href, @@ -188,7 +198,7 @@ export class TabButton implements ComponentInterface, AnchorInterface { 'tab-has-label-only': hasLabel && !hasIcon, 'tab-has-icon-only': hasIcon && !hasLabel, [`tab-layout-${layout}`]: true, - 'ion-activatable': true, + 'ion-activatable': canActivate, 'ion-selectable': true, [`tab-button-shape-${shape}`]: shape !== undefined, 'ion-focusable': true, From 57a1e200da5e5c732df21e2d19dbe8c70c31b870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Rio?= Date: Mon, 24 Nov 2025 10:23:40 +0000 Subject: [PATCH 3/3] feat(tabButton): run lint --- core/src/components/item/item.tsx | 2 +- core/src/components/tab-button/tab-button.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/components/item/item.tsx b/core/src/components/item/item.tsx index 4b029dd03f6..93211adf2de 100644 --- a/core/src/components/item/item.tsx +++ b/core/src/components/item/item.tsx @@ -250,7 +250,7 @@ export class Item implements ComponentInterface, AnchorInterface, ButtonInterfac const mode = getIonMode(this); const shouldActivate = this.isClickable() || this.hasCover(); if (theme !== 'ionic') { - return shouldActivate; + return shouldActivate; } return mode === 'md' && shouldActivate; } diff --git a/core/src/components/tab-button/tab-button.tsx b/core/src/components/tab-button/tab-button.tsx index 5b820323e63..169e4bb0bf6 100644 --- a/core/src/components/tab-button/tab-button.tsx +++ b/core/src/components/tab-button/tab-button.tsx @@ -167,10 +167,10 @@ export class TabButton implements ComponentInterface, AnchorInterface { const theme = getIonTheme(this); const mode = getIonMode(this); if (theme !== 'ionic') { - return true; + return true; } return mode === 'md'; -} + } render() { const { disabled, hasIcon, hasLabel, href, rel, target, layout, selected, tab, inheritedAttributes } = this;