diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lustre/internals/vdom.gleam | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lustre/internals/vdom.gleam b/src/lustre/internals/vdom.gleam index 5d03b2b..c4cab69 100644 --- a/src/lustre/internals/vdom.gleam +++ b/src/lustre/internals/vdom.gleam @@ -2,6 +2,7 @@ import gleam/dict.{type Dict} import gleam/dynamic.{type Decoder, type Dynamic} +import gleam/float import gleam/int import gleam/json.{type Json} import gleam/list @@ -391,6 +392,9 @@ fn attribute_to_string_parts( "Atom" | "Bool" | "Boolean" if value == true_atom -> Ok(#(name, "")) "Atom" | "Bool" | "Boolean" -> Error(Nil) + "Int" -> Ok(#(name, int.to_string(dynamic.unsafe_coerce(value)))) + "Float" -> Ok(#(name, float.to_string(dynamic.unsafe_coerce(value)))) + // For everything else, we care whether or not the attribute is actually // a property. Properties are *Javascript* values that aren't necessarily // reflected in the DOM. |