mirror of
https://github.com/servo/servo.git
synced 2025-07-31 11:10:22 +01:00
Auto merge of #8400 - sylvesterwillis:arrow-key-scroll-on-input, r=jdm
Added call to event.PreventDefault on html text inputs and textareas. This change should prevent page scrolling when up/down buttons are pressed within text inputs and textboxes which should resolve issue #8379. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8400) <!-- Reviewable:end -->
This commit is contained in:
commit
f1565bdd82
2 changed files with 3 additions and 0 deletions
|
@ -656,6 +656,7 @@ impl VirtualMethods for HTMLInputElement {
|
||||||
}
|
}
|
||||||
RedrawSelection => {
|
RedrawSelection => {
|
||||||
self.force_relayout();
|
self.force_relayout();
|
||||||
|
event.PreventDefault();
|
||||||
}
|
}
|
||||||
Nothing => (),
|
Nothing => (),
|
||||||
}
|
}
|
||||||
|
|
|
@ -352,9 +352,11 @@ impl VirtualMethods for HTMLTextAreaElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.force_relayout();
|
self.force_relayout();
|
||||||
|
event.PreventDefault();
|
||||||
}
|
}
|
||||||
KeyReaction::RedrawSelection => {
|
KeyReaction::RedrawSelection => {
|
||||||
self.force_relayout();
|
self.force_relayout();
|
||||||
|
event.PreventDefault();
|
||||||
}
|
}
|
||||||
KeyReaction::Nothing => (),
|
KeyReaction::Nothing => (),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue