Closed Bug 1774639 Opened 4 years ago Closed 4 years ago

HTMLInputElement.focus({ preventScroll: true }); still scrolls to centre the input

Categories

(Core :: Panning and Zooming, defect)

Unspecified
Android
defect

Tracking

()

RESOLVED DUPLICATE of bug 1544660
Tracking Status
firefox101 --- affected
firefox102 --- affected
firefox103 --- affected

People

(Reporter: kbrosnan, Unassigned)

References

Details

From github: https://github.com/mozilla-mobile/fenix/issues/25606.

Steps to reproduce

  1. Referring to https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus
  2. Use the source provided in the 'Focus with option' section
  3. Works as expected, specifically, the button is not scrolled into view with the "button without scrolling"
  4. Use an <input> element instead of <button> element and repeat
  5. The "Click me to focus on the button without scrolling!" still scrolls down and focuses on the input.
  6. Works fine on desktop Firefox and on the DevTools emulator
  7. Sample HTML page to illustrate attached as a .txt file
    test.txt
    .

Expected behaviour

The <input> element should not be scrolled into view

Actual behaviour

The <input> element is still scrolled to and positioned in the centre of the viewport.

Device name

Samsung Galaxy S9+

Android version

Android 10

Firefox release type

Firefox

Firefox version

101.2.0 (Build #2015885215)

Device logs

No response

Additional information

No response

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

Moving to APZ component

This is an old Android bug, but would be nice to fix.

Component: General → Panning and Zooming
Product: GeckoView → Core
Summary: [Bug]: In Javascript, HTMLInputElement.focus({ preventScroll: true }); still scrolls to centre the input → HTMLInputElement.focus({ preventScroll: true }); still scrolls to centre the input
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.