timolins / react-hot-toast

Smoking Hot React Notifications 🔥
https://react-hot-toast.com
MIT License
9.61k stars 314 forks source link

Limit maximum toast height #215

Open fregante opened 2 years ago

fregante commented 2 years ago

It's possible that a long message is passed to a toast, especially when showing errors. It'd be good to limit the height automatically, which should definitely be less than 100vh in all scenarios anyway.

slhck commented 1 year ago

Did you figure this out? I have a large error message that should be in a scroll box, but when I set maxHeight, the text gets truncated at the top (it somehow scrolls to the middle).

This is without setting maxHeight:

image

But when I do (e.g. to calc(100vh - 100px)):

image

Notice that the beginning of the text is different. It somehow gets pushed to a negative x position.