Then the initial render works fine, but clicking on the Edit button results in this error appearing in the Javascript console:
HierarchyRequestError: Node cannot be inserted at the specified point in the hierarchy
After some investigation, I came up with a fix that I believe is a bug in the Replace.Patch() method. Below are the original implementation and my new one:
With the revised version of the method, everything works as expected. The call to findInDOM(p.Old.Parent(), root) is apparently returning an incorrect result. One alternative fix is to change that line to be findInDOM(p.Old, root).ParentNode(), with my revised version just being an optimization of that.
I believe I found a bug in the implementation of
Replace.Patch()
. Given some GopherJS resembling this:and this HTML template:
Then the initial render works fine, but clicking on the Edit button results in this error appearing in the Javascript console:
After some investigation, I came up with a fix that I believe is a bug in the Replace.Patch() method. Below are the original implementation and my new one:
With the revised version of the method, everything works as expected. The call to
findInDOM(p.Old.Parent(), root)
is apparently returning an incorrect result. One alternative fix is to change that line to befindInDOM(p.Old, root).ParentNode()
, with my revised version just being an optimization of that.