- From: Scott <notifications@github.com>
- Date: Fri, 03 Jan 2020 02:03:43 -0800
- To: w3c/editing <editing@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/editing/issues/200/570525650@github.com>
(Adapting this comment from <https://github.com/w3c/input-events/issues/91> as this seems to be the right place for it). We build a Chrome extension that can paste content within content editable fields via execCommand. If `beforeInput` is not dispatched by execCommand during paste, there are unavoidable compatibility issues that are created. Specifically, the order of events for a user generated paste action in Chrome is: * Paste * BeforeInput * Input If we need to dispatch the BeforeInput ourselves separate from the execCommand, we get the following order of events: * BeforeInput [event dispatched by us] * Paste [execCommand dispatch] * Input [execCommand dispatch] Since `Paste` and `Input` are both dispatch by execCommand, there is no possibility for us to insert our simulated `BeforeInput` at the right place in this sequence. This has the potential to break applications that depend on the correct order. A real-life example is it breaks the Trix 1.2.2 editor (https://github.com/basecamp/trix) which inputs text on both the Paste event and the BeforeInput event. They call `preventDefault()` on Paste event so when events follow the correct order, things work correctly. However, if we have the BeforeInput event before the Paste event, we get double insertions. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/editing/issues/200#issuecomment-570525650
Received on Friday, 3 January 2020 10:03:45 UTC