package virtual_dom
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=c32029907c0667369a500091533e2121c050e2392cfae7f07f2289e87c797390
doc/virtual_dom.keyboard/Vdom_keyboard/Keyboard_event_handler/Condition/index.html
Module Keyboard_event_handler.Condition
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.
type t = Keyboard_event.t -> boolval true_ : tval false_ : tval has_input_target : thas_input_target returns true if the event target is an input
val has_text_input_target : thas_text_input_target returns true if the event target is a text input or textarea element
val has_number_input_target : thas_number_input_target returns true if the event target is a number input
val has_form_element_target : thas_form_element_target returns true if the event target is part of a form
val has_target_id : id:string -> thas_target_id returns true if the event target has the given id
val has_target_class : class_:string -> thas_target_class returns true if the event target has the given class