diff options
author | Hayleigh Thompson <me@hayleigh.dev> | 2022-07-02 15:34:22 +0100 |
---|---|---|
committer | Hayleigh Thompson <me@hayleigh.dev> | 2022-07-02 15:34:22 +0100 |
commit | 20fae64962dbbe740ee3a733e4b932f8f5fb8350 (patch) | |
tree | 19b07bdd23298e723f260652fa37cda10d3dd1e6 | |
parent | 03030ea62b59e859e068aa76eb1692dd1ef807f7 (diff) | |
download | lustre-20fae64962dbbe740ee3a733e4b932f8f5fb8350.tar.gz lustre-20fae64962dbbe740ee3a733e4b932f8f5fb8350.zip |
:bug: Fix incorrectly-cased attribute and event names.
-rw-r--r-- | src/lustre/attribute.gleam | 2 | ||||
-rw-r--r-- | src/lustre/event.gleam | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/lustre/attribute.gleam b/src/lustre/attribute.gleam index dc74311..570088e 100644 --- a/src/lustre/attribute.gleam +++ b/src/lustre/attribute.gleam @@ -113,7 +113,7 @@ pub fn autocomplete (should_autocomplete: Bool) -> Attribute(action) { /// pub fn autofocus (should_autofocus: Bool) -> Attribute(action) { - property("autofocus", dynamic.from(should_autofocus)) + property("autoFocus", dynamic.from(should_autofocus)) } /// diff --git a/src/lustre/event.gleam b/src/lustre/event.gleam index 341f68b..3ffc16e 100644 --- a/src/lustre/event.gleam +++ b/src/lustre/event.gleam @@ -28,38 +28,38 @@ pub fn on_click (handler: fn (fn (action) -> Nil) -> Nil) -> Attribute(action) { /// pub fn on_mouse_down (handler: fn (fn (action) -> Nil) -> Nil) -> Attribute(action) { - on("mousedown", fn (_, dispatch) { handler(dispatch) }) + on("mouseDown", fn (_, dispatch) { handler(dispatch) }) } /// pub fn on_mouse_up (handler: fn (fn (action) -> Nil) -> Nil) -> Attribute(action) { - on("mouseup", fn (_, dispatch) { handler(dispatch) }) + on("mouseUp", fn (_, dispatch) { handler(dispatch) }) } /// pub fn on_mouse_enter (handler: fn (fn (action) -> Nil) -> Nil) -> Attribute(action) { - on("mouseenter", fn (_, dispatch) { handler(dispatch) }) + on("mouseEnter", fn (_, dispatch) { handler(dispatch) }) } /// pub fn on_mouse_leave (handler: fn (fn (action) -> Nil) -> Nil) -> Attribute(action) { - on("mouseleave", fn (_, dispatch) { handler(dispatch) }) + on("mouseLeave", fn (_, dispatch) { handler(dispatch) }) } /// pub fn on_mouse_over (handler: fn (fn (action) -> Nil) -> Nil) -> Attribute(action) { - on("mouseover", fn (_, dispatch) { handler(dispatch) }) + on("mouseOver", fn (_, dispatch) { handler(dispatch) }) } /// pub fn on_mouse_out (handler: fn (fn (action) -> Nil) -> Nil) -> Attribute(action) { - on("mouseout", fn (_, dispatch) { handler(dispatch) }) + on("mouseOut", fn (_, dispatch) { handler(dispatch) }) } // KEYBOARD EVENTS ------------------------------------------------------------- pub fn on_keypress (handler: fn (String, fn (action) -> Nil) -> Nil) -> Attribute(action) { - on("keypress", fn (e, dispatch) { + on("keyPress", fn (e, dispatch) { assert Ok(key) = e |> dynamic.field("key", dynamic.string) handler(key, dispatch) @@ -67,7 +67,7 @@ pub fn on_keypress (handler: fn (String, fn (action) -> Nil) -> Nil) -> Attribut } pub fn on_keydown (handler: fn (String, fn (action) -> Nil) -> Nil) -> Attribute(action) { - on("keydown", fn (e, dispatch) { + on("keyDown", fn (e, dispatch) { assert Ok(key) = e |> dynamic.field("key", dynamic.string) handler(key, dispatch) @@ -75,7 +75,7 @@ pub fn on_keydown (handler: fn (String, fn (action) -> Nil) -> Nil) -> Attribute } pub fn on_keyup (handler: fn (String, fn (action) -> Nil) -> Nil) -> Attribute(action) { - on("keyup", fn (e, dispatch) { + on("keyUp", fn (e, dispatch) { assert Ok(key) = e |> dynamic.field("key", dynamic.string) handler(key, dispatch) |