From 4dfa5ffc00869e4351f0487ec5c797b10e2f9950 Mon Sep 17 00:00:00 2001 From: bptato Date: Thu, 7 Sep 2023 18:01:31 +0200 Subject: 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...) --- src/html/dom.nim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/html') 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) -- cgit 1.4.1-2-gfad0