v147 · origin trial · forms
Autofill event
A new autofill event fires on input elements when the browser autofills them. Replaces the legacy heuristics — listening for input with no InputEvent.data, polling :autofill — with a single explicit signal.
concepts
-
Autofill Log
A small form that listens for the autofill event on every field. When you let Chrome's password / address autofill fire, the log captures which fields were filled, in what order, and what the values were.
-
Refill flow
Country lands first; the form mutates to ask for the right region-specific fields (US state, DE house number, BR neighbourhood), then calls
event.refill()to ask the browser for a second pass. -
Autofill vs Input Event
Side-by-side comparison of the old heuristic — sniffing
inputevents forinputType === ""— against the new explicitautofillevent. Simulate both user typing and browser autofill to see false positives and the clean signal. -
FormData Autofill Tester
A multi-field checkout form with per-field autofill simulation buttons. Fires the
autofillevent viaFormDataconstruction and shows the event sequence, timing, and filled values — the canonical pattern for reacting to autofill in multi-step wizards. -
Compatibility Lab
Detects
autofillevent support via"autofill" in HTMLInputElement.prototype. Simulates autofill on a live form and compares the clean event signal against the legacy heuristics —inputwith nodata,animationstarton:autofill. Provides a universal detection and fallback pattern.
why it exists
Forms that need to react to autofill — to update labels, validate cross-field constraints, fire analytics, or hydrate a wizard — have had no clean signal to hook into. Sites resorted to listening for input events with empty InputEvent.data (fragile), polling the :autofill CSS pseudo (worse), or sniffing the value across animationstart events triggered by autofill-specific keyframes (genuinely awful). The new autofill event is the missing primitive: a single explicit "the browser just filled this for the user" notification.
references
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗