Closed Bug 1746150 Opened 3 years ago Closed 3 years ago

Selecting target within MBT not possible due to constant refreshes of dropdown list

Categories

(DevTools :: Inspector, defect)

defect

Tracking

(firefox97 verified)

VERIFIED FIXED
97 Branch
Tracking Status
firefox97 --- verified

People

(Reporter: whimboo, Assigned: nchevobbe)

Details

Attachments

(1 file)

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:97.0) Gecko/20100101 Firefox/97.0 ID:20211212214735

When using the MBT and trying to inspect a specific target you can open the dropdown at the right top corner to select a specific window proxy. When there is a long list of items present and you have to scroll down it's not possible to find and select an item before the list is getting refreshed. At this moment the scrollbar directly jumps back to the top, and you have to start looking for the wanted entry again.

Maybe we should not refresh the list while the drop down is open?

Flags: needinfo?(nchevobbe)

When a new target is added (or one is removed), the button and its associated panel are re-rendered via React.
The MenuButton then calls tooltip.show in order to update the size of the panel to match the re-rendered content (https://searchfox.org/mozilla-central/rev/b80b92e2e10299ab405bdc4eb5109e9e23e25160/devtools/client/shared/components/menu/MenuButton.js#225,230-233)

HTMLTooltip#show does update the container bounds of its container (https://searchfox.org/mozilla-central/rev/b80b92e2e10299ab405bdc4eb5109e9e23e25160/devtools/client/shared/widgets/tooltip/HTMLTooltip.js#493), which does a few thing.
The interesting one is that it might sets the height of the container to "auto" (https://searchfox.org/mozilla-central/rev/b80b92e2e10299ab405bdc4eb5109e9e23e25160/devtools/client/shared/widgets/tooltip/HTMLTooltip.js#567)

In the case you the list overflowed, it won't anymore
Then after some computation, we set another height (https://searchfox.org/mozilla-central/rev/b80b92e2e10299ab405bdc4eb5109e9e23e25160/devtools/client/shared/widgets/tooltip/HTMLTooltip.js#665), which will make it overflow again (if the content size is big enough).

But we never resets the scroll position to what it was, and so it will reset to 0, which gives the issue mentioned in Comment 0.

I'll push a quick WIP patch that does fix the issue (but would need tests + maybe handling of horizontal overflow ? )

Flags: needinfo?(nchevobbe)
Assignee: nobody → nchevobbe
Attachment #9255740 - Attachment description: WIP: Bug 1746150 - [devtools] Reset top scroll position when updating HTMLTooltip container. → Bug 1746150 - [devtools] Reset vertical scroll position when updating HTMLTooltip container. r=jdescottes.
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5a47b2bff641 [devtools] Reset vertical scroll position when updating HTMLTooltip container. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch

Thanks Nicholas! This works great now.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: