Closed Bug 1873826 Opened 4 months ago Closed 3 months ago

Scrollbar gets hidden when opening dropdown menu

Categories

(bugzilla.mozilla.org :: Bug Creation/Editing, defect)

Production
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: arai, Assigned: arai)

References

(Regression)

Details

(Keywords: regression)

Attachments

(6 files)

Attached image Popup hides scrollbar

Steps to reproduce:

  1. on macOS's preference, configure the scrollbar to be always shown
  2. click Status drop down menu on bugzilla

Actual result:
scrollbar gets hidden, and the entire content gets shifted.

Expected result:
the drop down menu doesn't hide scrollbar.

This comes from the following code:

https://github.com/mozilla-bteam/bmo/blob/f52985e0aceb22147a9aea4d366b8814de198dd2/js/components/select.js#L794

class BzSelectElement extends HTMLElement {
...
  #showDropdown() {
...
    document.body.style.setProperty('overflow', 'hidden');

I suppose it's to suppress scroll which makes the drop down menu off from the anchor, but the scrollbar getting hidden/shown for each click is more problematic, given that happens while regular operation, and it's hard to operate on each menu if the entire page content shifts every time.

possible solutions:

  • (a) apply overflow-y: scroll + position: fixed instead (this resets the scroll position, and doesn't work well if the menu is opened with scrollTop != 0)
  • (b) just allow scrolling
  • (c) allow scrolling, and periodically update the menu position
Attached file GitHub Pull Request
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED

I took (c), with updating the position on scroll event

Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED

This change has caused a visual issue with Firefox on Windows that I have verified on my end. It causes a white bar on the right and/or left sides of the viewport where a scroll bar would normally be even if the scroll bar is not visible. If I disable to the CSS change using devtools, the bar disappears. Attaching screenshot.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

my PR won't cause the issue.
can we use it instead?

(In reply to Tooru Fujisawa [:arai] from comment #9)

my PR won't cause the issue.
can we use it instead?

Flags: needinfo?(kohei)

bug 1870891 patch is reverted and the problem no longer reproduces.

Status: REOPENED → RESOLVED
Closed: 4 months ago3 months ago
Resolution: --- → WORKSFORME
Flags: needinfo?(kohei)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: