From a2467edbd458eed9bec16ec8cddcb89c86a0b156 Mon Sep 17 00:00:00 2001 From: bptato Date: Fri, 1 Sep 2023 13:42:33 +0200 Subject: dom: fix previousElementSibling (again. ouch.) --- src/html/dom.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/html') diff --git a/src/html/dom.nim b/src/html/dom.nim index 4afa953e..6e2e2a04 100644 --- a/src/html/dom.nim +++ b/src/html/dom.nim @@ -1607,8 +1607,8 @@ func previousElementSibling*(elem: Element): Element {.jsfget.} = if p == nil: return nil for i in countdown(elem.index - 1, 0): let node = p.childList[i] - if p.childList[i].nodeType == ELEMENT_NODE: - return elem + if node.nodeType == ELEMENT_NODE: + return Element(node) return nil func nextElementSibling*(elem: Element): Element {.jsfget.} = -- cgit 1.4.1-2-gfad0