Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
fix for polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvonne Yip committed Sep 4, 2014
1 parent 8d9504f commit 428202a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core-dropdown-overlay.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,20 @@
return;
}

if (this.target.offsetParent !== this.relatedTarget.offsetParent && this.target.offsetParent !== this.relatedTarget) {
var t_op = this.target.offsetParent;
var r_op = this.relatedTarget.offsetParent;
if (window.ShadowDOMPolyfill) {
t_op = wrap(t_op);
r_op = wrap(r_op);
}

if (t_op !== r_op && t_op !== this.relatedTarget) {
console.warn('core-dropdown-overlay: dropdown\'s offsetParent must be the relatedTarget or the relatedTarget\'s offsetParent!');
}

// Don't use CSS to handle halign/valign here so _shouldPosition still works.

var inside = this.target.offsetParent === this.relatedTarget;
var inside = t_op === this.relatedTarget;
var ref = this.relatedTarget.getBoundingClientRect();

if (this._shouldPosition.left) {
Expand Down

0 comments on commit 428202a

Please sign in to comment.