v143 · miscellaneous
DataTransfer property for insertFromPaste, insertFromDrop and insertReplacementText input events
Populate the dataTransfer property on input events with inputType of insertFromPaste, insertFromDrop, and insertReplacementText to provide access to clipboard and drag-drop data during editing operations in contenteditable elements.
concepts
-
InputEvent.dataTransfer
Live contenteditable and textarea inspectors: compare
beforeinputwith the v143input.dataTransferpayload for paste, drop, and replacement text, then see why form controls still keepdataTransfernull. -
Paste sanitizer
The motivating editor use case: let paste commit, read dataTransfer on the v143
inputevent, and clean the editor using toggles for styles, images, links, or plain text. -
Drop attributor
Drag a research quote into the editor.
beforeinputlogs the incoming payload, then the v143input.dataTransferread verifies the custom attribution MIME and renders a cited block quote. -
Replacement text inspector
The third inputType —
insertReplacementText— for spell-check and autocorrect. Accept a suggestion, comparebeforeinputwith v143input.dataTransfer, and optionally intercept it as a track-changes mark.
why it shipped
This feature enhances input events by making the dataTransfer property available on input events for three key editing operations: