mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
fix(popover): allow target element to be positioned at left:0
fixes #6896
This commit is contained in:

committed by
Brandy Carney

parent
fa1537e88d
commit
ea450d41d3
@ -268,8 +268,9 @@ class PopoverTransition extends Transition {
|
||||
// If ev was passed, use that for target element
|
||||
let targetDim = ev && ev.target && ev.target.getBoundingClientRect();
|
||||
|
||||
let targetTop = targetDim && targetDim.top || (bodyHeight / 2) - (popoverHeight / 2);
|
||||
let targetLeft = targetDim && targetDim.left || bodyWidth / 2 - (popoverWidth / 2);
|
||||
let targetTop = (targetDim && 'top' in targetDim) ? targetDim.top : (bodyHeight / 2) - (popoverHeight / 2);
|
||||
let targetLeft = (targetDim && 'left' in targetDim) ? targetDim.left : (bodyWidth / 2) - (popoverWidth / 2);
|
||||
|
||||
let targetWidth = targetDim && targetDim.width || 0;
|
||||
let targetHeight = targetDim && targetDim.height || 0;
|
||||
|
||||
@ -328,8 +329,8 @@ class PopoverTransition extends Transition {
|
||||
// If ev was passed, use that for target element
|
||||
let targetDim = ev && ev.target && ev.target.getBoundingClientRect();
|
||||
|
||||
let targetTop = targetDim && targetDim.top || (bodyHeight / 2) - (popoverHeight / 2);
|
||||
let targetLeft = targetDim && targetDim.left || bodyWidth / 2;
|
||||
let targetTop = (targetDim && 'top' in targetDim) ? targetDim.top : (bodyHeight / 2) - (popoverHeight / 2);
|
||||
let targetLeft = (targetDim && 'left' in targetDim) ? targetDim.left : (bodyWidth / 2);
|
||||
let targetWidth = targetDim && targetDim.width || 0;
|
||||
let targetHeight = targetDim && targetDim.height || 0;
|
||||
|
||||
|
Reference in New Issue
Block a user