ITADN

fix(getElementInput): Select type number for HTMLSelectElement

#259Pull Requestmarkojerkic 创建于 2024-10-21
enhancement
M
markojerkiccommented
# Problem When field type is number and `Field` component is bound to an `HTMLSelectElement`, form will always receive `undefined`, as `HTMLSelectElement` does not have a property `valueAsNumber`. # Proposed solution Add a check if element is `HTMLSelectElement` and input `type` is number. If true, then return `parseFloat(value)`. # What I did I started by implementing the Solid solution, updated the examples for Solid and then pretty much just copy-pasted the fix for React, Preact and Qwik. I tested them all, they seem to work just fine.
合并状态:未合并 5 条评论