page up/down when focus is in text field should scroll containing page
Categories
(Core :: DOM: UI Events & Focus Handling, enhancement, P5)
Tracking
()
People
(Reporter: akkzilla, Unassigned)
References
(Blocks 1 open bug)
Details
(5 keywords)
User Story
user-impact-score:450
Attachments
(2 files, 1 obsolete file)
1.47 KB,
patch
|
Details | Diff | Splinter Review | |
768 bytes,
text/html
|
Details |
![]() |
||
Comment 1•26 years ago
|
||
![]() |
||
Comment 4•26 years ago
|
||
Reporter | ||
Comment 5•26 years ago
|
||
![]() |
||
Comment 6•26 years ago
|
||
Reporter | ||
Comment 7•26 years ago
|
||
![]() |
||
Comment 8•26 years ago
|
||
Comment 11•26 years ago
|
||
![]() |
||
Updated•25 years ago
|
Reporter | ||
Comment 14•25 years ago
|
||
![]() |
||
Comment 15•25 years ago
|
||
![]() |
||
Comment 16•25 years ago
|
||
![]() |
||
Comment 18•25 years ago
|
||
Comment 20•25 years ago
|
||
![]() |
||
Updated•25 years ago
|
![]() |
||
Comment 21•25 years ago
|
||
Comment 22•25 years ago
|
||
Comment 24•25 years ago
|
||
Reporter | ||
Comment 25•25 years ago
|
||
![]() |
||
Comment 26•25 years ago
|
||
Reporter | ||
Comment 27•25 years ago
|
||
![]() |
||
Comment 28•25 years ago
|
||
Comment 29•25 years ago
|
||
Comment 30•25 years ago
|
||
Comment 31•25 years ago
|
||
![]() |
||
Comment 32•25 years ago
|
||
Reporter | ||
Comment 34•25 years ago
|
||
Comment 35•25 years ago
|
||
Comment 36•25 years ago
|
||
![]() |
||
Comment 37•25 years ago
|
||
Comment 38•25 years ago
|
||
![]() |
||
Updated•25 years ago
|
Reporter | ||
Comment 39•25 years ago
|
||
Reporter | ||
Comment 40•25 years ago
|
||
![]() |
||
Comment 41•25 years ago
|
||
Comment 42•25 years ago
|
||
![]() |
||
Updated•25 years ago
|
![]() |
||
Comment 44•24 years ago
|
||
![]() |
||
Updated•24 years ago
|
![]() |
||
Comment 45•24 years ago
|
||
![]() |
||
Comment 46•24 years ago
|
||
![]() |
||
Updated•24 years ago
|
![]() |
||
Updated•24 years ago
|
Comment 47•23 years ago
|
||
![]() |
||
Updated•23 years ago
|
Comment 48•23 years ago
|
||
Comment 49•23 years ago
|
||
Comment 50•23 years ago
|
||
Comment 51•23 years ago
|
||
Comment 52•23 years ago
|
||
Comment 53•23 years ago
|
||
Comment 54•23 years ago
|
||
Comment 55•23 years ago
|
||
Comment 56•23 years ago
|
||
Comment 57•23 years ago
|
||
Comment 58•23 years ago
|
||
Comment 60•23 years ago
|
||
Comment 61•23 years ago
|
||
![]() |
||
Comment 62•22 years ago
|
||
![]() |
||
Comment 63•18 years ago
|
||
Updated•16 years ago
|
Comment 65•14 years ago
|
||
Comment 69•11 years ago
|
||
Comment 70•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Comment 71•5 years ago
|
||
Hello 21-yo thread! Please fix this problem. It is crucial to my comfort to have this function on websites. I need the "Page Down" button to actually scroll the page when text field is focused. Please, I don't want to go back to Chrome for this function.
Updated•3 years ago
|
Updated•2 years ago
|
Comment 72•2 years ago
|
||
(In reply to Randell Jesup [:jesup] (needinfo me) from comment #38)
My 2 cents: page up/down should scroll the item with focus if it's
scrollable.
If it's not scrollable, pop out one level, wash, rinse, and repeat. Simple,
makes sense to people, doesn't surprise people.
I think I'd prefer this version of the expected behaviour. However, maybe one clarification is to scroll the item with focus if it's "scrollable in the direction". That means if you are scrolling down in a textarea, and you are at the end of the textarea, we will pop out of the textarea to start scrolling the parent.
This closely follows the expected behaviour when using the mousewheel to scroll and the cursor is hovering over a textarea: When the textarea is scrollable in the desired direction, scroll the textarea. If not, scroll the parent.
This preserves the expected user behaviour of allowing scrolling inside the focused element while also allowing scrolling the parent as well.
Comment 73•1 year ago
|
||
Hi James,
It looks to me that this bug and bug 1239595 are duplicates. I am flagging you here because I am not quite sure if/how my action of setting duplication causes unexpected tracking consequences for the Web Compatibility:Knowledge Base bugs. These two platform bugs block different Knowledge Base bugs.
Comment 74•1 year ago
|
||
If they're dupes the right thing do do is to dupe the core bugs, dupe the knowledge base bugs, and ensure that the remaining kb bug is updated to block all the known site reports, and maybe add some text to the kb bug about the additional symptoms to look for. Unfortunately we don't yet have tooling to handle this automatically.
Comment 76•1 year ago
|
||
Hi Jamie and Masayuki,
We had discussions in bug 1806931 comment 14 which I believe is relevant to this issue. Apparently there are webcompat interests here, while there are also a11y concerns. Is there a compromised-but-acceptable solution to both webcompat and a11y? Bug 1806931 comment 14 seems to indicate no, but I wanted to ensure we're all aligned with the conclusion and the next steps. Thanks.
Well, we could redirect the commands to nsISelectionController
for the page here. So, technically, it's fixable without big patches.
On the other hand, I'm still worry about new complaints about the new/Chrome behavior. I think that we need scenarios that when users feel inconvenient with current behavior to solve the a11y concerns.
Comment 78•1 year ago
|
||
I agree that the concerns are contradictory and I haven't come up with any compromise solution. That said, regarding web compat, as I understand it, Chromium have acknowledged that they consider the current Chromium behaviour to be a bug. If they were to fix this, that would partially resolve the web compat issue here in a way which is better for accessibility. Of course, it's difficult to know if/when this is likely to get attention from them.
It might be a solution to fix the Chromium behavior by us.
Comment 80•1 year ago
|
||
(In reply to James Teh [:Jamie] from comment #78)
I agree that the concerns are contradictory and I haven't come up with any compromise solution. That said, regarding web compat, as I understand it, Chromium have acknowledged that they consider the current Chromium behaviour to be a bug. If they were to fix this, that would partially resolve the web compat issue here in a way which is better for accessibility. Of course, it's difficult to know if/when this is likely to get attention from them.
Good reminder! We're going to take this to our contact on the Chromium team.
Comment 81•1 year ago
|
||
If I understand correctly, the Chromium bug is about a textarea (e.g. in the bug report: "Type some text on the textarea"), while the Mozilla bug is about single-line text fields (in the bug description: "Since text fields don't know how to scroll", which is not true for textareas).
Comment 82•1 year ago
|
||
(In reply to Vincent Lefevre from comment #81)
If I understand correctly, the Chromium bug is about a textarea (e.g. in the bug report: "Type some text on the textarea"), while the Mozilla bug is about single-line text fields (in the bug description: "Since text fields don't know how to scroll", which is not true for textareas).
That's true. However, as I noted in bug 1806931 comment 13:
[Not consuming page up /down is] perhaps reasonable for single line inputs, which is the case here. I'd argue it isn't reasonable for multi-line inputs, though, and contentEditables can't specify whether they're multi-line or not in a standard way as far as I know, so this also applies there.
Also, in bug 1806931 comment 14, :masayuki noted:
Even a single line input may have big height like a multi-line input. Therefore, I think it could make users confused too.
Comment 83•1 year ago
|
||
There are pages that put the focus in a text field by default. So the current behavior is rather bad. Or perhaps there should be an option to control the behavior.
Comment 84•1 year ago
|
||
I don't think it's constructive to argue about this at length :), but to provide an alternative perspective, it's debatable whether the browser's behaviour is bad or whether the site is behaving badly. Arguably, the browser is doing exactly what it's supposed to do: when focus is in a text field, cursor navigation and scrolling should be restricted to the text field. If the intention is that the page should be immediately scrollable by the user, the page shouldn't set focus to a text field in the first place.
An option is one possibility, but this is obscure enough that I suspect most users won't know what the option means or won't know to look for it.
Updated•1 year ago
|
Comment 85•1 year ago
|
||
(In reply to James Teh [:Jamie] from comment #84)
An option is one possibility, but this is obscure enough that I suspect most users won't know what the option means or won't know to look for it.
When affected by an issue or wanting a different behavior, users often search the web (now, there's also AI) and will find the answer if the option is present.
BTW, Firefox could also also detect that the [Page Up] / [Page Down] keys are used in a single-line text input while they have no effect and propose the option as a tip.
Comment 86•1 year ago
|
||
So, as the patch author from 22 years ago... I don't think my patch will apply anymore. :-) I regret not pushing people to do something, however - we could have had a partial fix 22 years ago. However, what my patch tried to do could still be valid (fix this for the 1-line text input case). It really sounds like Chrome isn't likely to change their behavior anytime soon. I don't think our users will get that annoyed if we fix the one-line text case.
masayuki - you indicated it can be fixed for the simple case fairly easily, correct?
Yeah, I think so. sInputHandlers
does not register the PageUp
and PageDown
as page scroll keys. So, it can have them, and SelectionMoveCommands
can redirect the command to PresShell
.
Updated•11 months ago
|
Comment 88•10 months ago
|
||
(In reply to Masayuki Nakano [:masayuki] (he/him)(JST, +0900) from comment #87)
Yeah, I think so.
sInputHandlers
does not register thePageUp
andPageDown
as page scroll keys. So, it can have them, andSelectionMoveCommands
can redirect the command toPresShell
.
Hey Masayuki and here,
Trying to push for a clear next step here. Am I right that we can go implement the 1-line text input case without waiting on the Chrome bug to be fixed? Or should I mark this bug as webcompat:blocked instead?
Comment 89•10 months ago
|
||
I meant that it's easy to change our behavior for aligning to Chrome, but Jamie and I (and also the Chrome's bug reporter) don't think that Chrome's behavior is reasonable. So, I think Chrome developers should change their behavior unless they believe their behavior is better.
Updated•10 months ago
|
Comment 90•7 months ago
|
||
Here's a testcase, for convenience with testing this issue, and to help with reasoning about how our behavior currently differs from other browsers (and how this issue differs from e.g. bug 1239595 which was brought up as a possible-dupe but I think is in fact quite different).
STR for this testcase:
- Scroll down a bit and click to focus the text input or the textarea.
- Press your PageDown key repeatedly.
EXPECTED RESULTS:
After one or more PageDown keypresses (enough to reach the end of the text control), any subsequent PageDown keypresses should cause the top-level document to be scrolled. (In particular: when no more scrolling/caret-moving can be done inside the text control, then additional PageDown keypresses should be targeted at the nearest containing scrollport; along the lines of jesup's intuition in comment 38.) This is what happens for mousewheel scrolling, basically.
ACTUAL RESULTS:
PageDown just stops having any effect once the caret reaches the end of the text control.
Firefox gives ACTUAL RESULTS.
Chromium/WebKit give EXPECTED RESULTS.
Updated•28 days ago
|
Comment 92•28 days ago
|
||
Jamie - It seems like Chrome/chromium isn't likely to address this soon (or perhaps ever); 6 years with no action beyond an occasional comment from a user.
Given that and that we get repeated webcompat issues that link back to this, what's our best path forward? We certainly know how we would fix this; what would be the downside impact of doing so?
Updated•28 days ago
|
Comment 93•28 days ago
|
||
I described the downside impact in bug 1806931 comment 11:
The key point here is that the focus is within an editable element. When focus is within an editable element, I would expect cursor keys (including page down) to move the caret within the bounds of the editable element, not to scroll the page. Even with caret navigation enabled, cursor keys don't walk outside the bounds of an editable element. It seems surprising to me that page down would suddenly start scrolling the document once the caret hits the bottom of the editable element, potentially scrolling the editable element off the screen while it still has the focus.
The proposed solution violates keyboard expectations in an editable element, wherein cursor keys are normally confined. As I noted in comment 78, I don't know of a compromise here. Essentially, as I see it, we're confronted with a situation where we need to implement buggy behaviour (potentially making things worse for keyboard accessibility in editable content) in order to be more web compatible with buggy behaviour in other browsers.
Comment 94•27 days ago
|
||
I'm less concerned with mirroring other browsers (though it comes up repeatedly as a WebCompat issue). The reason I wanted to fix this originally was that I was working on a browser which ran as a thin client in cable settop boxes, and they had either IR remotes with 4 directionals and page up/down buttons, or IR keyboards with arrows and page up/down keys. It was very annoying that focusing a text element broke the ability to page up/down, since page up/down in a 1-line text element has no purpose. So from that point it made sense (and bubbling page up/down up if it's a multiline text element with no scrollbars, and perhaps bubbling if it's multiline at already fully scrolled in that direction). It was annoying to have to 'escape' a text element in order to view more of the screen (and they were displaying on pre-HD TVs, so you did LOTS of scrolling/pageup/down)
However, as you indicate, this will have issues for predictability for keyboard accessibility.
So the question is if there's a way to solve both of these. There might not be.
Comment 95•27 days ago
|
||
Thanks for the use case explanation. That's helpful.
I've tried to come up with a way to solve both, but have come up blank. Eventually, we'll have an Accessibility section in Settings, so a pref could work here. Normally, I don't think a pref is the right solution in cases like these; that effectively means we're sitting on the fence and we should ideally try to come up with the best compromise for everyone by default. However, there are solid arguments on both sides here. Even for accessibility, some argue that not being able to scroll with the keyboard (if they don't realise they can scroll by tabbing out of the editable area) is a keyboard accessibility issue.
Thanks, jesup. That's an interesting case for me. Indeed, with a remote control (meaning working with smaller viewport), PageDown
and PageUp
may have different expectations from the keyboard for PC. In the case, like Jamie said, adding a pref for the embedder may be a good solution. On the other hand, if it's the only scenario, I don't think we get same web-compat reports repeatedly.
On possible solution is, although it's not smart, repeatedly pressing PageDown
/PageUp
with NOOP result allows to "unlock" the scroll target. However, currently, we cannot check the source event in the command handler directly. So, we need some tricky idea to do this (maybe the focused editor can have the state?). However, even with doing this, users must expect that from the first key press. So, anyway this issue will repeatedly be reported.
Comment 97•21 days ago
|
||
The original usecase isn't relevant; just history. We do get webcompat reports against this on a regular basis, however, like in bug 1806931
Pressing multiple times would work, but not be obvious. Users usually will try several times if it doesn't work at first, which is the appeal. However, it's not a great solution since users will hit this again and again.
And see Jamie comment in https://bugzilla.mozilla.org/show_bug.cgi?id=1806931#c11 as well.
What does chrome do in a textfield? Looks like the (mostly) solved their textarea bug: https://issues.chromium.org/issues/41417806#comment33
Comment 98•20 days ago
|
||
Note also that when a textfield has the focus and is not visible, Firefox has an erratic behavior when one does PageDown or PageUp. Sometimes it does nothing, sometimes it scrolls the page to an unrelated position.
Description
•