Skip to content

Commit 73ef0f5

Browse files
committed
Allow changing the body text of toasts
1 parent 5059ba4 commit 73ef0f5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

simpletoast.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@
151151
body.textContent = text;
152152
el.appendChild(body);
153153
const toast = {
154+
setText: (newText) => {
155+
if (!newText || !toast.exists()) return;
156+
body.textContent = newText;
157+
},
154158
exists: () => toasts.has(id),
155159
close: () => {
156160
root.removeChild(el);

0 commit comments

Comments
 (0)