Skip to content

Commit

Permalink
Fix withoutPadding
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Oct 10, 2019
1 parent 271d7e6 commit dda3afd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/components/src/popover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ function withoutPadding( rect, element ) {
paddingLeft,
paddingRight,
} = window.getComputedStyle( element );
const top = parseInt( paddingTop, 10 );
const bottom = parseInt( paddingBottom, 10 );
const left = parseInt( paddingLeft, 10 );
const right = parseInt( paddingRight, 10 );
const top = paddingTop ? parseInt( paddingTop, 10 ) : 0;
const bottom = paddingBottom ? parseInt( paddingBottom, 10 ) : 0;
const left = paddingLeft ? parseInt( paddingLeft, 10 ) : 0;
const right = paddingRight ? parseInt( paddingRight, 10 ) : 0;

return {
x: rect.left + left,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`Popover should pass additional props to portaled element 1`] = `
<div>
<div>
<div
class="components-popover is-bottom is-right components-animate__appear is-from-left is-from-top"
class="components-popover is-bottom is-center components-animate__appear is-from-top"
role="tooltip"
style=""
>
Expand All @@ -33,7 +33,7 @@ exports[`Popover should render content 1`] = `
<div>
<div>
<div
class="components-popover is-bottom is-right components-animate__appear is-from-left is-from-top"
class="components-popover is-bottom is-center components-animate__appear is-from-top"
style=""
>
<div
Expand Down

0 comments on commit dda3afd

Please sign in to comment.