Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrow keys in a focused text box scroll the page #8379

Closed
jdm opened this issue Nov 6, 2015 · 3 comments
Closed

Arrow keys in a focused text box scroll the page #8379

jdm opened this issue Nov 6, 2015 · 3 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Nov 6, 2015

We need to call preventDefault on the event that we process in handle_event for both HTMLTextAreaElement and HTMLInputElement (but only in the cases that we redraw the selection or dispatch input). If the default action for the event isn't prevented, we end up telling the compositor that the key wasn't handled so it can perform its default actions (like scrolling the page).

Testcase: https://hire.jobvite.com/CompanyJobs/Careers.aspx?c=qpX9Vfwa&k=Apply&j=ozy21fwU&utm_source=careers.mozilla.org&s=PDN&utm_medium=referral (press up and down in the textbox)
Code: components/script/dom/htmlinputelement.rs, components/script/dom/htmltextareaelement.rs

bors-servo added a commit that referenced this issue Nov 8, 2015
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 -->
@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Nov 8, 2015

No test?

@jdm
Copy link
Member Author

@jdm jdm commented Nov 8, 2015

What sort of automated test are you thinking of?

@jdm
Copy link
Member Author

@jdm jdm commented Nov 18, 2015

Fixed by #8400.

@jdm jdm closed this Nov 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.