Vdom.AttrSourceThis type covers both properties and attributes, despite the name.
create_float name float creates a simple float-only attribute
string_property name value creates a simple string-only property
bool_property name value creates a simple bool-only property
property name value creates a property with a generic value
This function does not affect hooks, styles, classes, or on_* handlers, since warnings due to merging those can be avoided. It allows disabling warnings for attributes that are unmergeable. Note that no merging behavior is changed by this function - it only changes whether warnings are emitted.
Example: If href is already on a node, then adding a suppress_merge_warning (href input) attribute to the node will not trigger a warning. However, adding another href which does not use suppress_merge_warnings to the node will again emit a warning. In other words, this function only suppresses warnings for an instance of an attribute, not all attributes of the same type. *
create_hook name hook creates a hook attribute with a name
many merges several attributes into one. It merges hooks, on_* event handlers, classes, and styles.
Input.combine functionval on_input :
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> string -> unit Ui_effect.t) ->
ton_input fires every time the input changes, i.e., whenever a key is pressed in the input field. The current contents are returned as an OCaml string as a convenience
val on_change :
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t -> string -> unit Ui_effect.t) ->
ton_change fires when the input is complete, i.e., when enter is pressed in the input field or the input field loses focus. The current contents are returned as an OCaml string as a convenience
val on_file_input :
(Js_of_ocaml.Dom_html.event Js_of_ocaml.Js.t ->
Js_of_ocaml.File.fileList Js_of_ocaml.Js.t ->
unit Ui_effect.t) ->
ton_file_input is like on_input but for file picker input elements (i.e. type=file). Instead of passing the value of the input as a string, the list of selected files is passed.
See Vdom_input_widgets.File_select, or, if you are a bonsai user, Bonsai_web_ui_form.Elements.File_select, for a convenient API that wraps this.
val on_double_click :
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t -> unit Ui_effect.t) ->
tval on_mousemove :
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t -> unit Ui_effect.t) ->
tval on_mousedown :
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t -> unit Ui_effect.t) ->
tval on_mouseenter :
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t -> unit Ui_effect.t) ->
tval on_mouseleave :
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t -> unit Ui_effect.t) ->
tval on_mouseover :
(Js_of_ocaml.Dom_html.mouseEvent Js_of_ocaml.Js.t -> unit Ui_effect.t) ->
tval on_keypress :
(Js_of_ocaml.Dom_html.keyboardEvent Js_of_ocaml.Js.t -> unit Ui_effect.t) ->
tval on_keydown :
(Js_of_ocaml.Dom_html.keyboardEvent Js_of_ocaml.Js.t -> unit Ui_effect.t) ->
tval on_pointerdown :
(Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t -> unit Ui_effect.t) ->
tval on_pointerup :
(Js_of_ocaml.Dom_html.pointerEvent Js_of_ocaml.Js.t -> unit Ui_effect.t) ->
tval on_mousewheel :
(Js_of_ocaml.Dom_html.mousewheelEvent Js_of_ocaml.Js.t -> unit Ui_effect.t) ->
tval on_paste :
(Js_of_ocaml.Dom_html.clipboardEvent Js_of_ocaml.Js.t -> unit Ui_effect.t) ->
tval on_animationend :
(Js_of_ocaml.Dom_html.animationEvent Js_of_ocaml.Js.t -> unit Ui_effect.t) ->
tHooks to set mouse events listeners on window. This is needed as if we only set them on individual elements we will miss ones that happen outside of the viewport