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

  1. InputEvent.dataTransfer

    Live contenteditable and textarea inspectors: compare beforeinput with the v143 input.dataTransfer payload for paste, drop, and replacement text, then see why form controls still keep dataTransfer null.

  2. Paste sanitizer

    The motivating editor use case: let paste commit, read dataTransfer on the v143 input event, and clean the editor using toggles for styles, images, links, or plain text.

  3. Drop attributor

    Drag a research quote into the editor. beforeinput logs the incoming payload, then the v143 input.dataTransfer read verifies the custom attribution MIME and renders a cited block quote.

  4. Replacement text inspector

    The third inputType — insertReplacementText — for spell-check and autocorrect. Accept a suggestion, compare beforeinput with v143 input.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:

references