Add invalid styles to mdc-select
See original GitHub issueWhat MDC-Web Version are you using?
0.2.0
What browser(s) is this bug affecting?
All browsers, but most visible in Safari.
What OS are you using?
OSX
What are the steps to reproduce the bug?
- Create an mdc-select component in a form.
- Add a default option with no value.
- Add some more options with values.
- Add the
required
attribute to the select. - In the browser, change from the default option.
- Change back to the default option.
The mdc-select
component does not apply a class such as mdc-select--invalid
nor does it appear to exist in the source code. This should also happen when the form is submitted in an invalid state.
What is the expected behavior?
This should work the same as it already does for mdc-textfield
, expected to automatically apply and remove a class such as mdc-select--invalid
when the select changes validation state.
What is the actual behavior?
No class is applied and in Safari there is no visual indication that the field is invalid.
Any other information you believe would be useful?
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
html - Material Design Components select menu not rendering ...
I just added this code to solve this problem: .mdc-select__native-control ...
Read more >invalid - CSS: Cascading Style Sheets - MDN Web Docs
The :invalid CSS pseudo-class represents any , , or other element whose contents fail to validate.
Read more >packages/mdc-select/README.md · Gitee 极速下载/material ...
To style a select menu as required and enable validation, add the mdc-select--required class to the mdc-select element and set the aria-required attribute...
Read more >React Material Web Components | Select Menus - RMWC
Using CSS Loader. import '@rmwc/select/styles';. Or include stylesheets. '@rmwc/select/select.css';; '@material/select/dist/mdc.select.css'; ...
Read more >Card-mod - Add css styles to any lovelace card
Important; } style: | # This is wrong # ha-tile-info$: ... entity: input_select.robo_mop style: | :host { --mdc-select-ink-color: {{ 'white' ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lynnjepsen I went through the code in material-components-web/packages/mdc-select/ and, unless I’m missing something, this has not been implemented. I also didn’t see any references to this in any of the CHANGELOG.md notes.
Please re-open. Thanks!
Work to be done:
mdc-select--invalid
style:invalid
style (for native control)