Interface: UseAutofillSubmitOptions<TName>
Defined in: use-autofill-submit.ts:26
Options for useAutofillSubmit.
Type Parameters
TName
TName extends string
Properties
enabled?
optionalenabled?:boolean
Defined in: use-autofill-submit.ts:35
Turn the watcher off without unmounting. Defaults to true.
fields
fields: readonly
TName[]
Defined in: use-autofill-submit.ts:33
name of every field that must be filled before submitting. All of them
must satisfy UseAutofillSubmitOptions.isFilled, so a manager that
fills only the password on a blank email stays quiet. Inline array
literals are fine; only the names' contents matter.
interactionEvents?
optionalinteractionEvents?: readonly (keyofHTMLElementEventMap)[]
Defined in: use-autofill-submit.ts:42
Events on the form that count as the user being present. Defaults to
keydown, pointerdown and touchstart.
isFilled?
optionalisFilled?: (value,name,element) =>boolean
Defined in: use-autofill-submit.ts:50
Decide whether a field counts as filled. Defaults to a non-empty value.
Parameters
value
string
name
TName
element
Returns
boolean
onAutofill?
optionalonAutofill?: (context) =>boolean|void
Defined in: use-autofill-submit.ts:55
Called when a complete fill is detected, right before submitting. Return
false to veto it; the hook stays armed and tries again on the next fill.
Parameters
context
AutofillContext<TName>
Returns
boolean | void
pollInterval?
optionalpollInterval?:number
Defined in: use-autofill-submit.ts:37
How often, in milliseconds, field values are sampled. Defaults to 250.
requireInteraction?
optionalrequireInteraction?:boolean
Defined in: use-autofill-submit.ts:48
Require one of UseAutofillSubmitOptions.interactionEvents before
anything auto-submits, so credentials restored on page load can never sign
someone straight back in. Defaults to true.
submit?
optionalsubmit?: (context) =>void
Defined in: use-autofill-submit.ts:60
Replace how the form is submitted. Defaults to form.requestSubmit()
(after reportValidity()), which takes the form's own onSubmit path.
Parameters
context
AutofillContext<TName>
Returns
void