Listening for any changes to the editor state


#1

Hey there,

I’m trying to create an event listener which gets triggered whenever the content in the editor changes. E.g. typing text, pasting, adding styles, etc.

Looking at the docs, I haven’t seen any handler that does this. Any ideas?


#2

You’ll have to look at transactions, specifically their docChanged property.


#3

Thanks @marijn :+1:

For anyone who’s looking for a quick solution, I ended up using the dispatchTransaction prop from the guide.