Closed Bug 1701928 Opened 3 years ago Closed 3 years ago

scroll-padding not respected when scrolling an input into view in response to typing.

Categories

(Core :: Layout: Scrolling and Overflow, defect)

Firefox 89
defect

Tracking

()

VERIFIED FIXED
89 Branch
Tracking Status
firefox89 --- verified

People

(Reporter: flackr, Assigned: emilio)

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (X11; CrOS x86_64 13597.105.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.208 Safari/537.36

Steps to reproduce:

  1. Navigate to https://codepen.io/flackr/pen/xxRodzY
  2. Click in the text box to focus it.
  3. Scroll down such that the textbox is out of view
  4. Type to scroll the textbox into view

Actual results:

Expect the textbox to scroll 30px into view so as not to be occluded by the top bar according to the 30px padding. This is what happens if you call scrollIntoView on the textbox.

Expected results:

Instead, the textbox is only scrolled in to the edge of the viewport where it is not visible.

The Bugbug bot thinks this bug should belong to the 'Core::Layout' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Layout
Product: Firefox → Core

Robert, thanks for file the bug.

Did you accidentally swap the actual result and expected result in comment 0? This screenshot captured my test result on Firefox Nightly on Linux after step 4 (I click on the "screen into view" button). Chrome has the same behavior where the <input> is just below the "Reserved space".

Flags: needinfo?(flackr)

The scroll into view button is to compare the behavior to the scrollIntoView API. The incorrect behavior is when you focus the textbox, scroll it out of view and then type characters into it while it is scrolled out of view.

Flags: needinfo?(flackr)

Thanks! I misunderstand step 4. It is actually typing any character in the <input> to bring it into the view. I can reproduce this bug.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Component: Layout → Layout: Scrolling and Overflow
Severity: -- → S3
Assignee: nobody → emilio
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3d209ba46c38
Selection scrolling should not ignore scroll-{margin,padding}. r=hiro,masayuki
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/28352 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
Flags: qe-verify+
Attached image screenshot_1701928

Hello! Reproduced the initial issue with Firefox 89.0a1 (20210330215136) on Windows 10x64 and attached test case.
The text box is no longer displayed under the reserved space banner with Firefox 89.0b3 (20210422190146) on Windows 10x64, macOS 11.2.3 and Ubuntu 20 but it seems that it still covered a little by it. Is this expected? Thank you in advance.

Flags: needinfo?(emilio)

I believe this is expected as the thing being scrolled into view is the text currently being entered in the input, not the entire textbox. E.g. in a textarea this would only scroll the current line into view not the whole textarea.

You should see the same behavior in a case without any scroll padding - the top of the textbox will likely be above the scrollport.

Yes, exactly. Thanks Robert :)

Flags: needinfo?(emilio)

Thank you both for the clarification! Closing this.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Upstream PR merged by jgraham
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: