Class: Dommy::InputEvent
Overview
‘InputEvent` — fired by `input` / `beforeinput`. Carries `data` (the inserted text, if any) and `inputType` (insertText, deleteContentBackward, etc.).
Constant Summary
Constants inherited from Event
Event::AT_TARGET, Event::BUBBLING_PHASE, Event::CAPTURING_PHASE, Event::NONE
Instance Attribute Summary
Attributes inherited from Event
Instance Method Summary collapse
- #__js_get__(key) ⇒ Object
-
#initialize(type, init = nil) ⇒ InputEvent
constructor
A new instance of InputEvent.
Methods inherited from Event
#__internal_clear_propagation_flags__, #__internal_mark_trusted__, #__internal_prepare_for_dispatch__, #__internal_record_path__, #__internal_set_current_target__, #__internal_set_dispatch_flag__, #__internal_set_event_phase__, #__js_call__, #__js_set__, #bubbles?, #default_prevented?, #immediate_propagation_stopped?, #init_event, #propagation_stopped?
Methods included from Bridge::Methods
Constructor Details
#initialize(type, init = nil) ⇒ InputEvent
Returns a new instance of InputEvent.
621 622 623 624 625 626 |
# File 'lib/dommy/event.rb', line 621 def initialize(type, init = nil) super @data = read_init(init, "data") @input_type = (read_init(init, "inputType") || "").to_s @is_composing = !!read_init(init, "isComposing") end |
Instance Method Details
#__js_get__(key) ⇒ Object
628 629 630 631 632 633 634 635 636 637 638 639 |
# File 'lib/dommy/event.rb', line 628 def __js_get__(key) case key when "data" @data when "inputType" @input_type when "isComposing" @is_composing else super end end |