Skip to content

fix: pick up field values filled by password managers and extensions - #296

Merged
brettflorio merged 2 commits into
mainfrom
fix/fx-890-autofill-values
Nov 20, 2026
Merged

brettflorio merged 2 commits into
mainfrom
fix/fx-890-autofill-values

Conversation

@pheekus

@pheekus pheekus commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Values filled into text, email, password and text area fields by password managers and other browser extensions now reach the form. Before, the field showed the value, but the form stayed unchanged: no Save button, and the value was not saved. Typing and pasting already worked. A fill that sends no event at all is still missed. No listener can catch it. Fixes FX-890.

How it works:

Vaadin 14 text fields keep the native <input> in their shadow root. Extensions set its value and dispatch new Event('input', { bubbles: true }). Script-made events are not composed, so they stop at that shadow root, and @input listeners on the field never run. Vaadin's own handler still sees the event.

src/utils/composed-vaadin-input.ts waits until vaadin-text-field and vaadin-text-area are defined, then wraps _onInput on their classes. When the original event was not composed and the field value changed, it dispatches a composed input from the field. It skips fields inside another vaadin-* element.

The util imports no Vaadin code, so loading it does not register any element. src/mixins/themeable.ts imports it. Elements load that module through Themeable or Translatable, so new elements get the fix without their own import.

The sign-in form's autofill poller is removed. It sent an input event and an edit every 250 ms for each filled field. The patch now covers those fills.

Password managers and other extensions fill a field with their own
script-made input event. It never left the Vaadin field's shadow root,
so the field showed the value but the form never saw it.

A Vaadin text field or text area that listens for `input` on the field
itself needs to import src/utils/composed-vaadin-input to see these
fills.

Fixes FX-890

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pheekus
pheekus marked this pull request as draft November 19, 2026 21:34
@pheekus pheekus self-assigned this Nov 19, 2026
@pheekus pheekus added the bug It's a bug, not a feature. label Nov 19, 2026
@pheekus
pheekus marked this pull request as ready for review November 19, 2026 22:10
- Skip the re-dispatch when the field sits inside another Vaadin
  element. Combo box and date picker treat any input from their text
  field as typing, so an extension fill opened their overlay.
- Skip it when the field value did not change, for example when
  `preventInvalidInput` rejects the fill.
- Patch the classes once they are defined instead of importing them.
  Loading the patch no longer loads or registers vaadin-text-area and
  vaadin-text-field. A Vaadin copy without `_onInput` is left alone.
- Load the patch once from the themeable mixin instead of from 11
  element files, so new elements get it without their own import.
- Remove the sign-in form's autofill poller. The patch now covers
  these fills, and the poller sent an input event and an edit every
  250 ms for each filled field.

Refs FX-890

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brettflorio
brettflorio merged commit 1baa276 into main Nov 20, 2026
7 checks passed
@brettflorio
brettflorio deleted the fix/fx-890-autofill-values branch November 20, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug It's a bug, not a feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants