This syntax usually works, but I'm getting an compilation error:
import js.jquery.*a
…
jq(button).click { e -> console.log(e) } // error here
The error is:
Error:(59, 16) Kotlin: None of the following functions can be called with the arguments supplied:
public final fun click(handler: org.w3c.dom.Element.(js.jquery.MouseClickEvent) -> kotlin.Unit): js.jquery.JQuery defined in js.jquery.JQuery
public final fun click(): js.jquery.JQuery defined in js.jquery.JQuery
It works if I use the verbose way:
jq(button).click {Element.(e: MouseClickEvent): Unit ->
e.preventDefault()
console.log(e)
}
Rob