Software Engineering Manager focusing on React and Rails. Family of three 👨👩👦 from Taiwan/Costa Rica/Moscow 🇹🇼🇨🇷🇷🇺.
Lazy learner of languages: Español + English + 中文 + 日本語.
For me, usually the toast should not be closed by just clicking it -- instead, it should be closed using the "X" button that you have added in the corner, plus maybe a "close" caption.
In that case, for toast itself I would use ye good olde <div>.
The reasoning behind why the toast shouldn't get closed just by clicking it is because it may contain text that you need to copy, IE:
"Error (1001): Segmentation Fault when trying to create a new profile".
Sometimes not being able to copy text online because of some action triggered makes usability harder.
I'm a fan of Open Source and have a growing interest in serverless and edge computing. I'm not a big fan of spiders, but they're doing good work eating bugs. I also stream on Twitch.
I whipped this up pretty quick, so the x is just for show at the moment, since the quick thing to do for demo purposes was to close on click or if the ENTER key is pressed and the toast has focus.
The real question was what type of element to use. So far it’s one vote for <div />.
Software Engineering Manager focusing on React and Rails. Family of three 👨👩👦 from Taiwan/Costa Rica/Moscow 🇹🇼🇨🇷🇷🇺.
Lazy learner of languages: Español + English + 中文 + 日本語.
I'm a fan of Open Source and have a growing interest in serverless and edge computing. I'm not a big fan of spiders, but they're doing good work eating bugs. I also stream on Twitch.
For me, usually the toast should not be closed by just clicking it -- instead, it should be closed using the "X" button that you have added in the corner, plus maybe a "close" caption.
In that case, for toast itself I would use ye good olde
<div>
.The reasoning behind why the toast shouldn't get closed just by clicking it is because it may contain text that you need to copy, IE:
Sometimes not being able to copy text online because of some action triggered makes usability harder.
Cheers!
Fair point about copying text. Next version. 😉
I whipped this up pretty quick, so the x is just for show at the moment, since the quick thing to do for demo purposes was to close on click or if the ENTER key is pressed and the toast has focus.
The real question was what type of element to use. So far it’s one vote for
<div />
.Me too,
<div>
for the win. I wouldn't use<button>
for sure as the toast itself wouldn't have the close action later on as you say.Note: nice cover photo 😆 (I'm hungry now).
I made it so you have to click the
x
button now.