mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(popover): originate animation from right in RTL/MD (#17381)
This commit is contained in:
committed by
Liam DeBeasi
parent
fc43faa86a
commit
bc3aa21695
@@ -4,8 +4,10 @@ import { Animation } from '../../../interface';
|
||||
* Md Popover Enter Animation
|
||||
*/
|
||||
export function mdEnterAnimation(AnimationC: Animation, baseEl: HTMLElement, ev?: Event): Promise<Animation> {
|
||||
const isRTL = document.dir === 'rtl';
|
||||
|
||||
let originY = 'top';
|
||||
let originX = 'left';
|
||||
let originX = isRTL ? 'right' : 'left';
|
||||
|
||||
const contentEl = baseEl.querySelector('.popover-content') as HTMLElement;
|
||||
const contentDimentions = contentEl.getBoundingClientRect();
|
||||
@@ -24,7 +26,6 @@ export function mdEnterAnimation(AnimationC: Animation, baseEl: HTMLElement, ev?
|
||||
? targetDim.top
|
||||
: bodyHeight / 2 - contentHeight / 2;
|
||||
|
||||
const isRTL = document.dir === 'rtl';
|
||||
const targetLeft =
|
||||
targetDim != null && 'left' in targetDim
|
||||
? isRTL
|
||||
@@ -49,7 +50,7 @@ export function mdEnterAnimation(AnimationC: Animation, baseEl: HTMLElement, ev?
|
||||
bodyWidth
|
||||
) {
|
||||
popoverCSS.left = bodyWidth - contentWidth - POPOVER_MD_BODY_PADDING;
|
||||
originX = 'right';
|
||||
originX = isRTL ? 'left' : 'right';
|
||||
}
|
||||
|
||||
// If the popover when popped down stretches past bottom of screen,
|
||||
|
||||
Reference in New Issue
Block a user