about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-09-25 19:37:50 +0200
committerbptato <nincsnevem662@gmail.com>2024-09-25 19:40:55 +0200
commitf411e836912a1b602c9be3470f1328e6013292ba (patch)
tree60ab0126e086fa9b319d4da07d5de8940a998c64
parente7c727c7fe399fb1b04af767495ec9d80183bc91 (diff)
downloadchawan-f411e836912a1b602c9be3470f1328e6013292ba.tar.gz
buffer: make non-button form-associated elems clickable
d7085253b7 was too strict; in particular, it broke cases where copyable
text is placed in text areas.
-rw-r--r--src/server/buffer.nim5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index 71eef321..c22b02db 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -319,9 +319,8 @@ func isClickable(styledNode: StyledNode): bool =
   let element = Element(styledNode.node)
   if element of HTMLAnchorElement:
     return HTMLAnchorElement(element).href != ""
-  if element of FormAssociatedElement:
-    if FormAssociatedElement(element).form == nil:
-      return false
+  if element.isButton() and FormAssociatedElement(element).form == nil:
+    return false
   return element.tagType in ClickableElements
 
 func getClickable(styledNode: StyledNode): Element =