Closed Bug 1571376 Opened 5 years ago Closed 4 years ago

scrollbar-width CSS property value is also applied to select dropdown arrow

Categories

(Core :: Layout: Form Controls, defect, P3)

69 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: zavecz.krisztina, Assigned: emilio)

References

Details

Attachments

(2 files, 1 obsolete file)

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

Steps to reproduce:

Set all elements on page to use thin scrollbars:

* {
  scrollbar-width: thin
}

Implement a select field with options.

I'm using Firefox Developer Edition 69.0b10 (64-bit) on Windows 10.

Actual results:

The scrollbar-width property's value is used on the select element's dropdown arrow as well. So the dropdown arrow becomes way too small.

Expected results:

IMO a select's dropdown arrow should not be considered as a scrollbar, thus, scrollbar-width CSS property shouldn't affect it at all.

Workaround: to select, I reset scrollbar-width to "auto", but this shouldn't be necessary.

(ie. for Chrome, I'm using the ::-webkit-scrollbar-thumb pseudo element to style the scrollbars, and the values I give there do not apply to select element's dropdown button. This would be the desirable approach).

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Layout: Form Controls
Product: Firefox → Core

Can you share a screenshot of the rendering of data:text/html,<select style="scrollbar-width: thin"><option>ABCDE</option></select>?

This looks like a plausible side effect of this line of code, but it looks fine here on Linux anyway (some OSes paint the <select> differently).

Flags: needinfo?(zavecz.krisztina)

Oh, I guess I can repro everywhere with data:text/html,<select style="scrollbar-width: thin; border: 1px solid"><option>ABCDE</option></select>

Assignee: nobody → emilio
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3

(So I don't forget)

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Flags: needinfo?(zavecz.krisztina)

Try this one

*:not(select) {
  scrollbar-width: thin
}

(In reply to Anand Rathod from comment #7)

Try this one

*:not(select) {
  scrollbar-width: thin
}

This is not that I couldn't solve it by CSS, it is a bug, because scrollbar-width property should not apply to dropdown arrows.

Yes, this is clearly a bug. Sorry I still haven't found time to debug why the test I added in the patch still fails in some platforms...

I need to do that, though I'm swamped with other stuff atm, and this has a very easy work-around (select { scrollbar-width: auto }) that it's hard to prioritize.

I'll try to get to it, I promise... Though If somebody wants to take over the patch and figure it out I'd be happy to help/mentor :)

Blocks: 1634109
Flags: needinfo?(emilio)

That is, so that the select dropdown button always take the size of a
native scrollbar rather than a potentially custom scrollbar.

Attachment #9083019 - Attachment is obsolete: true
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9de39e80563d
Make all themes support non-disappearing scrollbar sizes. r=mstange
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: