v147 · Forms · Web APIs

Autofill vs Input Event

Compare the old heuristic approach — listening for input events where InputEvent.inputType is empty — against the new explicit autofill event. Simulate both user typing and browser autofill to see where the old approach produces false positives and misses.

Old heuristic legacy

Listens for input where event.inputType === "" — a proxy for autofill.

Type in the fields, then simulate autofill.

New autofill event Chrome 147

Listens for the explicit autofill event — fires only on real autofill, never on typing.

Type in the fields, then simulate autofill.

how this works

The old heuristic fires on every input event and checks if event.inputType is an empty string. This is unreliable: programmatic value assignments and some IME inputs also produce empty inputType, causing false positives. The new autofill event is an explicit browser signal — it fires only when the browser actually fills fields.

// Old heuristic — unreliable
input.addEventListener('input', e => {
  if (e.inputType === '') {
    console.log('maybe autofilled?');   // false positives possible
  }
});

// New explicit event — Chrome 147+
input.addEventListener('autofill', e => {
  console.log('definitely autofilled!'); // no ambiguity
});

references

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗