Open eliyas5044 opened 5 years ago
Hey @eliyas5044 - I was looking for the same thing. Looking at the source code, turns out you can use icon
instead of text
.
action: {
icon: 'close',
onClick: (e, toastObject) => {
toastObject.goAway(0);
}
}
Setting icon: 'close' might work for a standard icon set, but I'm using Font Awesome Light. So I set the iconPack to "custom-class" and
action: {
icon: {
name: "fal fa-times",
after: true
},
onClick: (e, toastObject) => {
toastObject.goAway(0);
}
}
This does not work. It does correctly put after the text, but it doesn't insert the classes.
My purpose is to put a simple X at the right edge so a user can close.
Is there any ideas now?) The same for me, I use svg icons and try to implement callback or custom-class in action icon, but it not works. Version 1.1.27
this one works:
options: {
iconPack:'custom-class'
action: {
icon: 'icon-cross',
onClick: (_e, toastObject) => {
toastObject.goAway(0)
}
}
}
Great work. Everything is fine for me. Just want to modify
action
text as Material Icon for closing toast.