diff options
author | bptato <nincsnevem662@gmail.com> | 2023-09-07 18:01:31 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-09-07 18:01:54 +0200 |
commit | 4dfa5ffc00869e4351f0487ec5c797b10e2f9950 (patch) | |
tree | 805101846cd049e5533e89aca330c7dec38781a2 /src/html | |
parent | 9668b12761cb121852c2bcc085b8f6b18eb4bfc6 (diff) | |
download | chawan-4dfa5ffc00869e4351f0487ec5c797b10e2f9950.tar.gz |
dom: set input type to text if not given
HTMLInputElement.inputString depends on inputType not being unknown. (Maybe we should move this logic out of the html parser module entirely and just set text as the default value...)
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/dom.nim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim index 0f9cb3ef..1237d701 100644 --- a/src/html/dom.nim +++ b/src/html/dom.nim @@ -2137,6 +2137,8 @@ proc reflectAttrs(element: Element, name, value: string) = let input = HTMLInputElement(element) input.reflect_str "value", value input.reflect_str "type", inputType, inputType + if input.inputType == INPUT_UNKNOWN: + input.inputType = INPUT_TEXT input.reflect_bool "checked", checked of TAG_OPTION: let option = HTMLOptionElement(element) |