js_of_ocaml
js_of_ocaml copied to clipboard
[FEATURE REQUEST] Svg elements or not compatible with eventTarget
According to the w3c, SVG shapes should handle events like onclick, onmouseover and so on.
But the svg elements (ie polygon) does not inherit from Dom_html.eventTarget. And this exemple does not compile :
Lwt_js_events.clicks dom_polygon ( fun mouseEvent _ ->
Js.Opt.iter mouseEvent##.target (fun target ->
target##.style##.fill := (Js.string "blue");
)
)
Is there a reason why ? Or is there another way to achieve this ?
I didn't really look at your issue, but bindings in js_of_ocaml are surely not exhaustive, feel free to open a pull request to fix this.