Ah yes indeed, this is an issue that was fixed in 4.0 beta, but still remains in 3.6. The problem is that on.click takes a function of Dom.MouseEvent, and your pass it a function of Dom.Event, so there is an implicit upcast (see Coerce in the error message) which WebSharper doesn't recognize.

A simple fix in your case is to take Dom.MouseEvent as argument in action; but I should be able to backport the 4.0 fix to 3.6 so that your original code would work as well.

By on 1/19/2017 4:35 AM ()

Oh I see, thanks that works when changing the action to:

1
2
3
4
[<JavaScript>]
let action (el:Dom.Element) (ev:Dom.MouseEvent) =
	JS.Alert "hello"
By on 1/21/2017 2:18 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper