shithub: mycel

Download patch

ref: af7eaeb14a83747ac7b5bdb5cfd3f0812d8219a3
parent: 61737f59c0ea6595d0eca0e4830cef85433d0778
author: Philip Silva <philip.silva@protonmail.com>
date: Sun Feb 21 07:15:34 EST 2021

no submit without surrounding form element

--- a/browser/browser.go
+++ b/browser/browser.go
@@ -388,7 +388,11 @@
 		},
 		Keys: func(k rune, m draw.Mouse) (e duit.Event) {
 			if k == 10 {
-				browser.submit(n.Ancestor("form").DomSubtree, nil)
+				f := n.Ancestor("form")
+				if f == nil {
+					return
+				}
+				browser.submit(f.DomSubtree, nil)
 				return duit.Event{
 					Consumed:   true,
 					NeedLayout: true,