React, Vue, Angular Form Fields Checklist | Auto Fill Fake Data
← Back to blog

React, Vue, and Angular form fields that break your tests (and how to fix each one)

Getting a plain text input to update in a controlled form is one problem. Custom dropdowns, date pickers, and file uploads are five different problems wearing the same trench coat — each one stores its value differently, and each one needs its own fix.

Jump to the checklist ↓ Install the extension
5
field types covered
3
frameworks affected
1
field with no JS fix at all
0
of these Auto Fill Fake Data leaves broken
TL;DR
  • Custom dropdowns — no value to set; you have to click the option.
  • Date pickers — native inputs work with the native-setter fix; full calendar-popup pickers usually need a real click.
  • File uploads — direct assignment is blocked by the browser; use a DataTransfer object instead.
  • Checkbox / radio groups — toggle each input individually; don't assume a "select all" checkbox re-syncs itself.
  • Autocomplete / tag inputs — type first to trigger the filter, then click the option that appears.

Jump straight to a field type, or read straight through:

▾
Custom dropdowns
react-select, MUI Select, mat-select — no native setter exists.
📅
Date pickers
Native inputs vs. calendar-popup components behave very differently.
📎
File uploads
Browsers block direct assignment — DataTransfer is the only way in.
☑
Checkbox / radio groups
Group state and derived "select all" checkboxes are the trap.
🏷
Autocomplete / tags
A two-stage interaction: filter first, then select from what renders.
🧭
General approach
A four-step way to figure out any field you haven't seen before.
Foundation: why this happens at all →
If you haven't already, it's worth reading why plain input.value assignment fails on controlled components first — every fix below builds on that same native-setter technique.

The short version: React, Vue, and Angular all keep the "real" value of an input in their own internal state, not in the DOM. A plain text field just needs that state updated correctly, which the native-setter technique handles. The five field types below are harder because the value isn't a simple string owned by one input — it's an object, a file, an array, or something that only changes in response to a specific user gesture. Here's what each one actually needs.

A native <select> has a real DOM value and the native-setter fix works on it exactly like a text input. The problem is that most production forms don't use a native select — they use react-select, MUI's Select, Angular Material's mat-select, or a hand-rolled version of the same pattern: a button that opens a floating list of options, none of which are a real <select><option> pair under the hood.

There is no single native setter to call here, because there's no native form control storing the value — it's plain component state, and that state only changes inside a click handler attached to each option. The only working fix is to reproduce the interaction a real user performs: open the dropdown, locate the option element that matches the target value (usually by its text content, since there's rarely a stable selector), and dispatch a real pointer/click event on it.

Watch for options rendered in a React portal — react-select and MUI append the option list to document.body, not inside the dropdown's own DOM subtree. Querying for options inside the visible field container will come back empty even while the list is open on screen.

2. Date pickers

This one splits into two genuinely different problems depending on what's actually rendered:

Native <input type="date"> — this is a real form control with a real value (in YYYY-MM-DD format regardless of how it displays to the user), so the native-setter technique works on it the same as any text input. No calendar UI to deal with.

Custom JS date pickers (react-datepicker, MUI's DatePicker, Angular Material's datepicker) — these pair a text input with a calendar popup, and the underlying value is usually stored as a Date object in component state, not a string. Typing text directly into the input may or may not work depending on whether the library parses free text against its expected format — some accept it, many silently ignore anything that doesn't match their internal mask. The reliable path is the same as the dropdown case: open the picker, navigate to the right month, and click the day cell.

Related: date format is also a localization bug →
Even when a date field works correctly, DD/MM vs. MM/DD ambiguity across locales is one of the most common form bugs that ships to production. Covered field-by-field in the multilingual testing checklist.

3. File upload inputs

File inputs are the one field type on this list where the fix has nothing to do with React, Vue, or Angular — it's a browser security restriction that applies everywhere. Modern browsers make input.value read-only on <input type="file"> specifically so that a webpage can't silently populate a file field and trick a user into uploading something they didn't choose. Assigning to it directly does nothing, framework or no framework.

The sanctioned workaround is to construct the file entirely in memory and hand it to the input through the one API designed for this: DataTransfer.

const dt = new DataTransfer(); dt.items.add(new File(["content"], "test.png", { type: "image/png" })); input.files = dt.files; input.dispatchEvent(new Event("change", { bubbles: true }));

No file needs to exist on disk — the File object is built entirely in JavaScript. Two things trip people up here: forgetting that file inputs fire a change event, not input; and drag-and-drop upload zones, which usually aren't a real file input at all and need simulated dragenter/dragover/drop events carrying the same DataTransfer payload instead.

4. Checkbox and radio groups

A single controlled checkbox is genuinely simple — the native-setter fix applies to it exactly like a text input, since a checkbox's value is still just a DOM property (checked instead of value). The bug shows up specifically in groups: a set of checkboxes whose combined state lives in one array on the parent (selectedTags: ['a', 'b']), or a radio group where the framework itself enforces that only one input can be true.

Toggling one checkbox correctly updates that one input's own state, but it does nothing for sibling inputs — and it does nothing for any derived UI built on top of the group, like a "select all" checkbox that's supposed to reflect whether every item underneath it is checked. That derived state is computed separately (often in a useEffect, a Vue watcher, or an Angular computed signal), and it won't magically recalculate just because you clicked something — it recalculates because the framework's normal render cycle ran, which it will, but it's worth explicitly testing rather than assuming.

5. Autocomplete and tag inputs

Combobox-style fields (role="combobox" paired with role="listbox") — type-ahead search boxes, tag pickers, multi-select chips — combine two pieces of state: a text buffer for whatever's currently typed, and a separate committed list of selected items. This makes them a two-stage interaction rather than a single click or a single value assignment.

You can't select an option that hasn't rendered yet, and most of these components only render their filtered option list after receiving real input. So the working sequence is: use the native-setter technique to type into the text buffer (which also fires the input event that triggers the library's filtering logic), wait for the now-filtered listbox to appear, then click the matching option the same way you would for a plain custom dropdown.

The general approach, for any field you haven't seen before

New component libraries show up constantly, and you won't always recognize the pattern on sight. This four-step process works for identifying the right fix on anything:

1
Inspect what's actually in the DOM
Is it a real native form element (<select>, <input type="date">) wearing custom CSS, or a fully custom widget built from <div>s and <button>s with no native control underneath at all?
2
Check who owns the value
If it's a native element, the framework is still tracking it — use the native-setter technique. If there's no native element, the value lives entirely in component state and only changes through a specific event handler.
3
Find the exact event the handler listens for
Click, pointerdown, and mousedown aren't interchangeable — some libraries only respond to one of them. Check the component's source or its event listeners in DevTools if the obvious one doesn't work.
4
Verify derived state, not just the field itself
Did a "select all" checkbox, a running total, or a validation message update the way it should have? A field can accept your simulated input and still leave the rest of the form's state stale.

Common misconceptions

Assumption: "If the input is visible in the DOM, I can just set a value on it."
Reality: only true for genuinely uncontrolled native elements. The moment a framework tracks the value in state — which is the default in React, and common in Vue and Angular — direct assignment gets silently overwritten on the next render.
Assumption: "File inputs just need the right value string, like any other field."
Reality: input.value is read-only on file inputs in every modern browser, for security reasons that have nothing to do with your framework. DataTransfer is the only supported path in.
Assumption: "A custom dropdown behaves the same as a native <select> once you know the trick."
Reality: there is no trick that avoids clicking the option — custom dropdowns have no native setter to call at all, because there's no native form control underneath them.
Assumption: "Once I've solved this for React, Vue and Angular work the same way."
Reality: the underlying cause is the same across all three, but specific libraries have their own quirks worth testing individually — Angular Material's mat-select and Vue components with async-loaded option lists are the two that most often surprise people who assumed the React fix would just transfer over.

Further reading

FAQ

It needs to be clicked. Custom dropdowns (react-select, MUI Select, mat-select) have no single native value setter — the value only changes in response to a real click on an option element, so any working automation has to open the list and click the matching option rather than trying to assign a value directly.
Build a File object in memory, wrap it in a DataTransfer, assign that to the input's files property, and dispatch a change event. Browsers block direct assignment to input.value on file inputs for security, so DataTransfer is the only supported path — no real file on disk is required.
It fills native date inputs and text-based date fields directly. Fully custom calendar-popup pickers that require a click-through UI are the one field type in this checklist that still needs a manual click in the calendar.
The underlying problem — the framework tracking value in its own state rather than the DOM — is the same across all three, and the native-setter fix works for all of them. The differences show up in specific component libraries: Angular Material's mat-select and Vue's async-loaded option lists each have their own quirks worth testing separately.

Auto Fill Fake Data handles the native-setter fix, checkbox groups, and autocomplete filtering automatically on every field it fills — no manual scripting required.

Install free — Chrome Web Store