Skip to content

Commit

Permalink
Fix #144: restore non-Expr based Client.on.* functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Feb 1, 2018
1 parent ad77a18 commit d14537e
Show file tree
Hide file tree
Showing 3 changed files with 432 additions and 2 deletions.
12 changes: 11 additions & 1 deletion WebSharper.UI.Tests/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,17 @@ module Main =
let rv = Var.Create { x = "red"; y = { z = "green"; t = "test" } }
div [Attr.Style "color" rv.V.y.z] [
text "Test text x.V: enter a color: "
Doc.Input [attr.style ("background: " + rv.V.y.z)] (rv.LensAuto(fun v -> v.y.z))
Doc.Input [
attr.style ("background: " + rv.V.y.z)
on.click (fun el ev ->
let f x = x // Inner generic function that fails to compile if this lambda is passed as an Expr.
// This checks that we are calling:
// Client.on.click : (Element -> Event -> unit) -> Attr
// and not:
// Html.on.click : Expr<Element -> Event -> unit> -> Attr
()
)
] (rv.LensAuto(fun v -> v.y.z))
Doc.PasswordBoxV [attr.style ("background: " + rv.V.y.z)] rv.V.y.z
text (" You typed: " + rv.V.y.z)
V(ul [] (rv.V.y.z |> Seq.map (fun c -> li [] [text (string c)] :> Doc))).V
Expand Down

0 comments on commit d14537e

Please sign in to comment.