MCPcopy Create free account
hub / github.com/formkit/formkit / toggleChecked

Function toggleChecked

packages/inputs/src/features/radios.ts:13–17  ·  view source on GitHub ↗

* Sets the value of a radio button when checked. * * @param node - A @formkit/core#FormKitNode | FormKitNode. * @param event - Event * * @public

(node: FormKitNode, event: Event)

Source from the content-addressed store, hash-verified

11 * @public
12 */
13function toggleChecked(node: FormKitNode, event: Event) {
14 if (event.target instanceof HTMLInputElement) {
15 node.input(optionValue(node.props.options, event.target.value))
16 }
17}
18
19/**
20 * Checks if the value being checked is the current value.

Callers

nothing calls this directly

Calls 1

optionValueFunction · 0.90

Tested by

no test coverage detected