diff options
author | bptato <nincsnevem662@gmail.com> | 2024-09-25 19:37:50 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-09-25 19:40:55 +0200 |
commit | f411e836912a1b602c9be3470f1328e6013292ba (patch) | |
tree | 60ab0126e086fa9b319d4da07d5de8940a998c64 | |
parent | e7c727c7fe399fb1b04af767495ec9d80183bc91 (diff) | |
download | chawan-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.nim | 5 |
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 = |