Skip to content
Permalink
Browse files

fix(popover): originate animation from right in RTL/MD (#17381)

  • Loading branch information...
abennouna authored and liamdebeasi committed Feb 5, 2019
1 parent fc43faa commit bc3aa2169520536c9fc1ca7a6f0dc90ffe1b744a
Showing with 4 additions and 3 deletions.
  1. +4 −3 core/src/components/popover/animations/md.enter.ts
@@ -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,

0 comments on commit bc3aa21

Please sign in to comment.
You can’t perform that action at this time.