sciactive / pnotify

Beautiful JavaScript notifications with Web Notifications support.
https://sciactive.com/pnotify/
Apache License 2.0
3.65k stars 513 forks source link

Positioning issues when using custom stack. #315

Closed tomaswindsor closed 6 years ago

tomaswindsor commented 6 years ago

When I define my own stack and pass it in options, I get strange positioning issue on created overlays. Initially the positioning of created notices are correct, but once they disappear, the newly created notices appear somewhat below and move (via animation) to the right position. Now the really strange part is that if I pass the default stack as the argument, this doesn't happen, but if I create the exact copy of the default stack and pass it, it does. Why does the behavior change when the passed stacks have exactly same values is beyond my comprehension. Also if I modify the default stack directly by changing properties of PNotify.prototype.options.stack, this problem doesn't occur.

hperrin commented 6 years ago

This is fixed in v4 (in alpha). It had to do with how PNotify was determining if a notice was visible, and then adding its margin (even though it was invisible) to the nextpos values.