Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was already some commented-out code in place to expose the
target
of an event; I assume it was commented out because the type signature wantstarget
to return aVNode
, but it is unclear how to marshal the value back to aVNode
. Personally, I believe that return value is wrong, becauseVNode
is a virtual DOM node, but what we get fromevent.target
is an actual DOM node, and the virtual-dom works, virtual → actual is one-way (or that's what I gathered).Anyway, since marshalling from JS DOM nodes to
VNode
isn't very useful anyway IMO, I changed things such that the DOM node is just returned as-is, as aJSVal
. This is obviously not typesafe, but other than that, it works, and allows me to pull properties out of the event target (in my particular use case, thevalue
, which gets fed back into the reactive event loop on the Haskell side of things).A proper solution would instead marshal to a properly typed something, but I figured that'd be a future improvement.