package virtual_dom

  1. Overview
  2. Docs
OCaml bindings for the virtual-dom library

Install

Dune Dependency

Authors

Maintainers

Sources

virtual_dom-v0.16.0.tar.gz
sha256=0c6f07894dce56db88d46b3aa4f2cad1a84aeaf0009560a285492f9f2959d565

doc/virtual_dom.keyboard/Vdom_keyboard/Keyboard_event_handler/Condition/index.html

Module Keyboard_event_handler.ConditionSource

A Condition.t is a condition based on a keyboard event (which importantly includes the event's focus). This is intended to be used in keyboard event handlers that look at the keyboard event to determine whether or not to take a certain action.

E.g. if a user presses 'j' while focused on a table, the event handler might handle this by moving the user's focus down by one row in the table, but if the user presses 'j' while typing into a text box, the event handler would ignore the event.

Sourcetype t = Keyboard_event.t -> bool
Sourceval true_ : t
Sourceval false_ : t
Sourceval not_ : t -> t
Sourceval and_ : t -> t -> t
Sourceval or_ : t -> t -> t
Sourceval has_input_target : t

has_input_target returns true if the event target is an input

Sourceval has_text_input_target : t

has_text_input_target returns true if the event target is a text input or textarea element

Sourceval has_number_input_target : t

has_number_input_target returns true if the event target is a number input

Sourceval has_form_element_target : t

has_form_element_target returns true if the event target is part of a form

Sourceval has_target_id : id:string -> t

has_target_id returns true if the event target has the given id

Sourceval has_target_class : class_:string -> t

has_target_class returns true if the event target has the given class

OCaml

Innovation. Community. Security.