From ab55e6be3f4bf2b927fd2811bfc596520e7cda65 Mon Sep 17 00:00:00 2001 From: Austin-Spriggs Date: Sat, 13 Jun 2026 23:34:45 -0500 Subject: [PATCH] fix: helper function that determines the ion-menu animation side now takes parent element direction attribute into consideration --- core/src/components/menu/menu.tsx | 2 +- core/src/utils/helpers.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/src/components/menu/menu.tsx b/core/src/components/menu/menu.tsx index 4769f609914..36d29a0b491 100644 --- a/core/src/components/menu/menu.tsx +++ b/core/src/components/menu/menu.tsx @@ -499,7 +499,7 @@ export class Menu implements ComponentInterface, MenuI { * Menu direction animation is calculated based on the document direction. * If the document direction changes, we need to create a new animation. */ - const isEndSide = isEnd(this.side); + const isEndSide = isEnd(this.side, this.el); if (width === this.width && this.animation !== undefined && isEndSide === this.isEndSide) { return; } diff --git a/core/src/utils/helpers.ts b/core/src/utils/helpers.ts index e32956c35eb..79f52a35aa8 100644 --- a/core/src/utils/helpers.ts +++ b/core/src/utils/helpers.ts @@ -319,10 +319,15 @@ export const pointerCoord = (ev: any): { x: number; y: number } => { * Given a side, return if it should be on the end * based on the value of dir * @param side the side + * @param hostElement the host element * @param isRTL whether the application dir is rtl */ -export const isEndSide = (side: Side): boolean => { - const isRTL = document.dir === 'rtl'; +export const isEndSide = (side: Side, hostElement?: Element): boolean => { + const isRTL = hostElement + ? hostElement.closest('[dir]')?.getAttribute('dir') === 'rtl' + : document.dir === 'rtl' + ; + switch (side) { case 'start': return isRTL;