apvarun / toastify-js

Pure JavaScript library for better notification messages
https://apvarun.github.io/toastify-js/
MIT License
2.13k stars 230 forks source link

"offset" option does not appear to be used in init #63

Closed liester closed 3 years ago

liester commented 3 years ago

The docs show offset as a property that can be used to more precisely position the toast notification. Looking at toastify -> init function: https://github.com/apvarun/toastify-js/blob/master/src/toastify.js#L30

Expected behavior: When offset is provided as part of the options object, it is used to determine the positioning of the toast notification.

Current behavior: offset option does not appear to be used in the toast construction.

apvarun commented 3 years ago

Hey @liester, I think you missed L61 where it's used.

Here is an example of how offset works: https://codesandbox.io/s/focused-engelbart-wtgk3

liester commented 3 years ago

Well that's embarrassing. You are correct. In my head setting the offset to 0 on x and y would have placed the toast directly on the edge of the screen. It was a misunderstanding on my part. Thank you for the quick response.