Skip to content

Commit

Permalink
Merge pull request Pikaday#853 from laoneo/patch-2
Browse files Browse the repository at this point in the history
Do not set position out of viewport
  • Loading branch information
rikkert authored Nov 5, 2020
2 parents 3dead65 + 2bd5c48 commit dd80c0a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pikaday.js
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,14 @@
top = top - height - field.offsetHeight;
bottomAligned = false;
}

if (left < 0) {
left = 0;
}

if (top < 0) {
top = 0;
}

this.el.style.left = left + 'px';
this.el.style.top = top + 'px';
Expand Down

0 comments on commit dd80c0a

Please sign in to comment.