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
2 changes: 1 addition & 1 deletion core/src/components/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 7 additions & 2 deletions core/src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down