js_of_ocaml icon indicating copy to clipboard operation
js_of_ocaml copied to clipboard

[FEATURE REQUEST] Svg elements or not compatible with eventTarget

Open Chimrod opened this issue 9 years ago • 1 comments

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 ?

Chimrod avatar Sep 05 '16 20:09 Chimrod

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.

hhugo avatar Sep 12 '16 10:09 hhugo