Skip to content

Commit d7c135f

Browse files
committed
chore(gesture): check mode
1 parent eea4300 commit d7c135f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

demo/src/app/tabs/tabs.page.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ export class TabsPage implements OnInit, ViewDidEnter, ViewDidLeave {
3131
}
3232

3333
ionViewDidEnter() {
34-
this.registeredGestures.push(registerTabBarEffect(document.querySelector<HTMLElement>('ion-tab-bar')!));
34+
const tabBarGesture = registerTabBarEffect(document.querySelector<HTMLElement>('ion-tab-bar')!);
35+
if (tabBarGesture) {
36+
this.registeredGestures.push();
37+
}
3538
}
3639

3740
ionViewDidLeave() {

src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ const MiddleScale = 'scale(1.2)';
99
const MaxScale = 'scale(1.3)';
1010
const OverScale = 'scale(1.4)';
1111

12-
export const registerTabBarEffect = (ionTabBar: HTMLElement): Gesture => {
12+
export const registerTabBarEffect = (ionTabBar: HTMLElement): Gesture | undefined => {
13+
if (!ionTabBar.classList.contains('ios')) {
14+
return undefined;
15+
}
16+
1317
let gesture!: Gesture;
1418
let currentTouchedButton: HTMLIonTabButtonElement | null;
1519
let gestureMoveStartTime: number | null;

0 commit comments

Comments
 (0)