material-components / material-components-web

Modular and customizable Material Design UI components for the web
https://material.io/develop/web
MIT License
17.12k stars 2.15k forks source link

Remove native Firefox focus indicator in selects #2989

Open vokimon opened 6 years ago

vokimon commented 6 years ago

Bugs

What MDC Web Version are you using?

0.36.1

What browser(s) is this bug affecting?

Firefox 60 (I assume any other earlier too)

What OS are you using?

Linux

What are the steps to reproduce the bug?

What is the expected behavior?

Just the Material focus indicator.

What is the actual behavior?

You also see a dim box surrounding the native select, breaking the Material illusion that the whole thing is a single control.

Any other information you believe would be useful?

The workaround is to add the following css:

// Clears firefox native focus ring for mdc-selects
@-moz-document url-prefix() {
    .mdc-select, select, select:-moz-focusring, select::-moz-focus-inner {
       color: transparent !important;
       text-shadow: 0 0 0 #000 !important;
       background-image: none !important;
       border:0;
    }
}

Note that it is constrained to mdc-selects, because native selects not in mdc should not be affected.

I would do a PR but i have no idea where the sass is the proper place for it.

moog16 commented 6 years ago

Thanks for opening! This is definitely an issue.