fregante / GhostText

👻 Use your text editor to write in your browser. Everything you type in the editor will be instantly updated in the browser (and vice versa).
https://GhostText.fregante.com
MIT License
3.25k stars 116 forks source link

Dispatch events on `contentEditable` elements #216

Closed luisherranz closed 2 years ago

luisherranz commented 2 years ago

I was taking a look to see why Notion was not working properly and I noticed that for fields that are contentEditable, the events are not dispatched because the contentEditable wrapper doesn't have the element.dispatchEvent method bonded. Therefore, this conditional is never run.

I wonder if that was on purpose or not. Notion seems to depend on the input event, so it woks fine after this modification.

fregante commented 2 years ago

I wonder if that was on purpose

Probably not! Your change makes sense, did you have a chance to test it? Does it fix the issue?

luisherranz commented 2 years ago

Oh yes, it fixes Notion and doesn't break any other sites that I use 😄

fregante commented 2 years ago

I just realized that this was never shipped. Now it's in https://github.com/fregante/GhostText/releases/tag/22.3.17