Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions core/src/components/item/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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 {
Expand Down
14 changes: 12 additions & 2 deletions core/src/components/tab-button/tab-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Loading