vue-toasted icon indicating copy to clipboard operation
vue-toasted copied to clipboard

Updating toast text replaces icon and actions too

Open edtownend opened this issue 6 years ago • 4 comments

Hi, first, thanks for a great plugin!

I've got a toast containing a countdown that is updated every second using toast.text(newText);. The issue is that this replaces the entire content of the toast, including the icon and any actions on the toast.

As a workaround I've switched to wrapping the content I wish to replace in a and then replace just that via toast.el.getElementsByClassName('classname')[0].innerHTML = 'new content';. But, I don't know if I'm causing any other issues by updating the DOM directly. I suggest that the text method is updated to only alter the text content of the toast.

edtownend avatar Dec 18 '18 15:12 edtownend

@edtownend have the exact same issue with our app doing the exact same thing. the toast.text() class blows away my actions, icons, and classes

jamesparkes avatar Jan 03 '20 19:01 jamesparkes

Same issue, please let me know if you have found the miracle solution since

thermostat42 avatar Jan 29 '20 10:01 thermostat42

Hi, Can I pick this up?

dchinu97 avatar Nov 18 '20 14:11 dchinu97

For anyone still interested, I found a solution, by ammending the .change code to replace the content of text node of the container, rather than replacing the entire interior via .innerHTML node.childNodes[0].nodeValue = text; rather than 'node.innerHTML = text`

tws-pockets avatar Jul 30 '22 05:07 tws-pockets