package virtual_dom
-
virtual_dom
-
-
virtual_dom.keyboard
-
-
virtual_dom.layout
-
virtual_dom.svg
-
virtual_dom.ui_effect
-
virtual_dom.vdom_test_helpers
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
val simple :
?extra_attrs:Virtual_dom.Vdom.Attr.t list ->
?disabled:bool ->
string ->
on_click:(unit -> unit Virtual_dom.Vdom.Effect.t) ->
Virtual_dom.Vdom.Node.t
Though simple
is fairly trivial, it is provided as a convenient parallel to with_validation
val with_validation :
?extra_attrs:Virtual_dom.Vdom.Attr.t list ->
string ->
validation:('a, string) Core.Result.t ->
on_click:('a -> unit Virtual_dom.Vdom.Effect.t) ->
Virtual_dom.Vdom.Node.t
Takes a ('a, string) Result.t
that is typically the result of some validation performed incrementally. If the validation failed, the button will be disabled and will show a tooltip on hover with the error reason. If the validation is ok, the 'a
is passed to the on_click
handler. You can compose multiple validity checks with the Result
applicative interface.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>