* Select the correct values. * @param e - The input event emitted by the select.
(node: FormKitNode, e: Event)
| 77 | * @param e - The input event emitted by the select. |
| 78 | */ |
| 79 | function selectInput(node: FormKitNode, e: Event) { |
| 80 | const target = e.target as HTMLSelectElement |
| 81 | const value = target.hasAttribute('multiple') |
| 82 | ? Array.from(target.selectedOptions).map((o) => |
| 83 | optionValue(node.props.options, o.value) |
| 84 | ) |
| 85 | : optionValue(node.props.options, target.value) |
| 86 | node.input(value) |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Appends a placeholder to the options list. |