mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fire 'input' event after 'keypress' in input and textarea elements
This commit is contained in:
parent
08662cc64e
commit
5f0b3bd53c
4 changed files with 24 additions and 24 deletions
|
@ -403,17 +403,6 @@ impl VirtualMethods for HTMLTextAreaElement {
|
|||
KeyReaction::DispatchInput => {
|
||||
self.value_changed.set(true);
|
||||
self.update_placeholder_shown_state();
|
||||
|
||||
if event.IsTrusted() {
|
||||
let window = window_from_node(self);
|
||||
let _ = window.user_interaction_task_source().queue_event(
|
||||
&self.upcast(),
|
||||
atom!("input"),
|
||||
EventBubbles::Bubbles,
|
||||
EventCancelable::NotCancelable,
|
||||
&window);
|
||||
}
|
||||
|
||||
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
|
||||
event.mark_as_handled();
|
||||
}
|
||||
|
@ -424,6 +413,16 @@ impl VirtualMethods for HTMLTextAreaElement {
|
|||
KeyReaction::Nothing => (),
|
||||
}
|
||||
}
|
||||
} else if event.type_() == atom!("keypress") && !event.DefaultPrevented() {
|
||||
if event.IsTrusted() {
|
||||
let window = window_from_node(self);
|
||||
let _ = window.user_interaction_task_source()
|
||||
.queue_event(&self.upcast(),
|
||||
atom!("input"),
|
||||
EventBubbles::Bubbles,
|
||||
EventCancelable::NotCancelable,
|
||||
&window);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue