Closed Bug 1421659 Opened 7 years ago Closed 4 years ago

Console scrolls up when output changes size

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(firefox78 fixed)

RESOLVED FIXED
Firefox 78
Tracking Status
firefox78 --- fixed

People

(Reporter: Oriol, Assigned: nchevobbe)

References

Details

Attachments

(1 file)

1. Open the web console
2. Fill it with whatever, so that a scrollbar appears
3. Press Shift+Enter in order to write a new line in the input area
4. The input area grows up so the scrollbar is not scrolled to the bottom.
5. Scroll the scrollbar to the bottom
6. Write some letter in the input area.

Result: the scrollbar goes up
Expected: the scrollbar remains at the place where I left it.
This is probably jsterm height calculation acting weird here
Priority: -- → P2
Product: Firefox → DevTools
devtools.webconsole.jsterm.codeMirror=true (which is the default for Nightly) fixes the issue.

Other builds still have this problem.
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED

It also happen:

  • if you switch between inline and editor mode
  • if you resize the editor panel
  • if you resize the toolbox window

basically, any time the console output has a scrollbar and is resized.

Summary: Console scrolls up when modifying multiline input → Console scrolls up when output changes size

When resizing the output, if the height was modified, the scrollbar position
was updated and could lose its pinned-to-bottom state.
This patch adds a resizeObserver to the console output node, where we
scroll the output to the bottom if it's needed.
In order to be able to do that, some changes were done in how we were
detecting that the output was pinned to the bottom.
We now have an intersection observer on the last message element,
which flips a flag when the element isn't intersecting the viewport
anymore.
Some test cases are added to ensure the console has the expected
behavior in different situations.

Depends on D74708

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8c49d2500a16
Keep console output pinned to bottom when resizing. r=bomsy.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 78
Regressions: 1641554
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: