File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -499,7 +499,7 @@ export class Menu implements ComponentInterface, MenuI {
499499 * Menu direction animation is calculated based on the document direction.
500500 * If the document direction changes, we need to create a new animation.
501501 */
502- const isEndSide = isEnd ( this . side ) ;
502+ const isEndSide = isEnd ( this . side , this . el ) ;
503503 if ( width === this . width && this . animation !== undefined && isEndSide === this . isEndSide ) {
504504 return ;
505505 }
Original file line number Diff line number Diff line change @@ -319,10 +319,15 @@ export const pointerCoord = (ev: any): { x: number; y: number } => {
319319 * Given a side, return if it should be on the end
320320 * based on the value of dir
321321 * @param side the side
322+ * @param hostElement the host element
322323 * @param isRTL whether the application dir is rtl
323324 */
324- export const isEndSide = ( side : Side ) : boolean => {
325- const isRTL = document . dir === 'rtl' ;
325+ export const isEndSide = ( side : Side , hostElement ?: Element ) : boolean => {
326+ const isRTL = hostElement
327+ ? hostElement . closest ( '[dir]' ) ?. getAttribute ( 'dir' ) === 'rtl'
328+ : document . dir === 'rtl'
329+ ;
330+
326331 switch ( side ) {
327332 case 'start' :
328333 return isRTL ;
You can’t perform that action at this time.
0 commit comments