Ramonda

field-set-by-an-event

This fails the run. Where it is wrong about your code, // ramonda-check-ignore <reason> on the line says so, and the reason is printed on every run.

Reported when a component's commit work — @mounted, @updated, render() and the rest — sends a field an edit: dispatches input or change, clicks a checkbox, or writes its value, where state says what it shows.

The framework reports the same fault while running, as RMD062 — but only once the line actually runs. This is the same fault proved from the source instead.

What a field shows is state. Write it, and the commit's render shows it:

@state on = true;              // known at the start

@mounted
start() {
  this.text = this.saved;      // learned on mount
}

An edit that must go through the field — its handler, the form around it — is sent once the commit is over: queueMicrotask(() => this.box.current?.click()). An await before it does not say so — whether it waits depends on values — so the edit is handed to queueMicrotask there too. A library given the field is told its value through its own callback, which writes state.

Next