Closed Bug 1926983 Opened 1 year ago Closed 1 year ago

Stop changing the horizontal scroll with Mouse Down on Inspector

Categories

(DevTools :: Inspector, defect, P3)

Firefox 129
defect

Tracking

(firefox134 fixed)

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: andro.marian.v94, Assigned: nchevobbe)

References

Details

Attachments

(2 files)

Attached image firefox_HJmfSGFNTO.gif

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0

Steps to reproduce:

Horizontal scroll to see an argument and clicking on it to copy

Actual results:

The horizontall scroll is jumping to start when the mouse button is pressed down

Expected results:

The scroll position should not be changed.

Thanks for the report Marian.
I can reproduce, and I'm already seeing some version of this in Firefox 100, so this isn't recent.
This is caused as we're focusing the node https://searchfox.org/mozilla-release/rev/c284a53117c51009a607b527aca37bda477efd04/devtools/client/inspector/markup/views/markup-container.js#822-831

/**
 * Try to put keyboard focus on the current editor.
 */
focus() {
  // Elements with tabindex of -1 are not focusable.
  const focusable = this.editor.elt.querySelector("[tabindex='0']");
  if (focusable) {
    focusable.focus();
  }
},
Status: UNCONFIRMED → NEW
Ever confirmed: true

Setting the focus on the markup element was also triggering
the element to be scrolled into view, which causes a scroll
by default.
We don't need to scroll when the user clicked on the element,
as it's already visible, and worse, could cause horizontal scroll
to be reset, making it hard to edit an attribute.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2b57170f090c [devtools] Don't scroll markup node into view on click. r=devtools-reviewers,jdescottes.
Regressions: 1928003
Severity: -- → S3
Priority: -- → P3
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
QA Whiteboard: [qa-134b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: