mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-24 23:01:57 +08:00
fix(popover): update animation origin in RTL/MD (#17645)
Original main-axis origin fix was flawed in case of RTL. Invert the animation’s main-axis origin in case the popover’s position is adjusted. references #17012
This commit is contained in:

committed by
Brandy Carney

parent
9c48fa715d
commit
617453ba43
@ -47,12 +47,19 @@ export function mdEnterAnimation(AnimationC: Animation, baseEl: HTMLElement, ev?
|
||||
// exceeds the body width it is off screen to the right so adjust
|
||||
if (popoverCSS.left < POPOVER_MD_BODY_PADDING) {
|
||||
popoverCSS.left = POPOVER_MD_BODY_PADDING;
|
||||
|
||||
// Same origin in this case for both LTR & RTL
|
||||
// Note: in LTR, originX is already 'left'
|
||||
originX = 'left';
|
||||
} else if (
|
||||
contentWidth + POPOVER_MD_BODY_PADDING + popoverCSS.left >
|
||||
bodyWidth
|
||||
) {
|
||||
popoverCSS.left = bodyWidth - contentWidth - POPOVER_MD_BODY_PADDING;
|
||||
originX = isRTL ? 'left' : 'right';
|
||||
|
||||
// Same origin in this case for both LTR & RTL
|
||||
// Note: in RTL, originX is already 'right'
|
||||
originX = 'right';
|
||||
}
|
||||
|
||||
// If the popover when popped down stretches past bottom of screen,
|
||||
|
Reference in New Issue
Block a user