-
Notifications
You must be signed in to change notification settings - Fork 904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md-outlined-select issues: empty menu, wrong colors, wrong size #4312
Comments
index.ts: import '@material/web/select/outlined-select.js';
import '@material/web/select/select-option.js'; |
Yup! Need to import |
If you're still having issues with the 2nd theming problem, can you add a repro? |
Thank you for the info how to fix the 1st issue! Hi @asyncLiz Please look on this sample project. It uses custom theme from Material Theme Builder. https://lit.dev/playground/#gist=4ff91f11438699bb9adbf124a0d041e4 |
And an additional problem that I already saw in the second project.
|
Hi @asyncLiz, |
For the colors, it looks like you're missing some of the new tokens, specifically the For the width, @e111077 can you take a look? |
If the tokens are coming from the material theme builder, that project is out of date and that team is currently undergoing a rewrite of that project partly because it is not using the latest tokens; you need to add the surface-container tokens. Here's a quick tool I scratched up to generate the sys level tokens with the latest set of color tokens https://lit.dev/playground/#gist=abcc77f636c1b76506df860db6dc0faf&view-mode=preview |
Working on a fix to set width on the container, easy enough. Am running into a problem, though, where we would want the menu to be to be the same width as the textbox where we can't make the headline text For example, we can set In order to enable this, we'd have to require the user to tell md-select-option what is currently being slotted in which is bad DX. e.g. <md-select-option has-start="icon" headline=${reallyLongText}>
<md-icon data-variant="icon" slot="start">star</md-icon>
</md-select-option>
<md-select-option has-start="video-large" headline=${reallyLongText}>
<video data-variant="video-large" slot="start" src="..." ...></video>
</md-select-option> Here is an illustration of the problem:
|
related: #4312 This PR makes select inherit it's min. max, and normal width from host. It also makes list item make the headline not wrap. The effect this has is that the width of the menu in select will match that of the select input, but if the contents of the menu are wider than the width of the select, then the menu will be wider than the select input. PiperOrigin-RevId: 534244900
Looks very interesting and cool! But could you advice me what should be used as the "Source color" in my case? I set the following parameters on the Material Theme Builder for the theme that I need:
Which one to use to generate correct |
updated the link above. Please use the |
I've added all the missing tokens that are shown in your project but were missing from the Material Theme Builder tokens: /* light, additional colors */
--md-sys-color-highest-surface-light: #e8d8be;
--md-sys-color-surface-dim-light: #e8d8be;
--md-sys-color-surface-bright-light: #fff8f2;
--md-sys-color-surface-container-lowest-light: #ffffff;
--md-sys-color-surface-container-low-light: #fff2df;
--md-sys-color-surface-container-light: #fcecd1;
--md-sys-color-surface-container-high-light: #f7e6cc;
--md-sys-color-surface-container-highest-light: #f1e0c6;
--md-sys-color-inverse-on-primary-light: #572700; /* dark, additional colors */
--md-sys-color-highest-surface-dark: #413826;
--md-sys-color-surface-dim-dark: #191204;
--md-sys-color-surface-bright-dark: #413826;
--md-sys-color-surface-container-lowest-dark: #140d02;
--md-sys-color-surface-container-low-dark: #221a0a;
--md-sys-color-surface-container-dark: #271e0e;
--md-sys-color-surface-container-high-dark: #322918;
--md-sys-color-surface-container-highest-dark: #3d3421;
--md-sys-color-inverse-on-primary-dark: #ffe8dc; Then, I added the missing variables to the light and dark theme that refer to the new tokens: light: --md-sys-color-highest-surface: var(--md-sys-color-highest-surface-light);
--md-sys-color-surface-dim: var(--md-sys-color-surface-dim-light);
--md-sys-color-surface-bright: var(--md-sys-color-surface-bright-light);
--md-sys-color-surface-container-lowest: var(--md-sys-color-surface-container-lowest-light);
--md-sys-color-surface-container-low: var(--md-sys-color-surface-container-low-light);
--md-sys-color-surface-container: var(--md-sys-color-surface-container-light);
--md-sys-color-surface-container-high: var(--md-sys-color-surface-container-high-light);
--md-sys-color-surface-container-highest: var(--md-sys-color-surface-container-highest-light);
--md-sys-color-inverse-on-primary: var(--md-sys-color-inverse-on-primary-light); dark: --md-sys-color-highest-surface: var(--md-sys-color-highest-surface-dark);
--md-sys-color-surface-dim: var(--md-sys-color-surface-dim-dark);
--md-sys-color-surface-bright: var(--md-sys-color-surface-bright-dark);
--md-sys-color-surface-container-lowest: var(--md-sys-color-surface-container-lowest-dark);
--md-sys-color-surface-container-low: var(--md-sys-color-surface-container-low-dark);
--md-sys-color-surface-container: var(--md-sys-color-surface-container-dark);
--md-sys-color-surface-container-high: var(--md-sys-color-surface-container-high-dark);
--md-sys-color-surface-container-highest: var(--md-sys-color-surface-container-highest-dark);
--md-sys-color-inverse-on-primary: var(--md-sys-color-inverse-on-primary-dark); And it works! Lit playground: |
Could you think of any solution for the correct width of the |
As a compromise for now, I'm shooting for this behavior with min-width 100% since we can't ellipse truncate rn: min-width-select.mp4 |
related: #4312 This PR makes select inherit it's min. max, and normal width from host. It also makes list item make the headline not wrap. The effect this has is that the width of the menu in select will match that of the select input, but if the contents of the menu are wider than the width of the select, then the menu will be wider than the select input. PiperOrigin-RevId: 534244900
related: #4312 This PR makes select inherit it's min. max, and normal width from host. It also makes list item make the headline not wrap. The effect this has is that the width of the menu in select will match that of the select input, but if the contents of the menu are wider than the width of the select, then the menu will be wider than the select input. PiperOrigin-RevId: 535695646
The above change has been submitted |
I think this is fixed now, including exposing |
I noticed two issues with
md-outlined-select
:Code:
Online Demo
md-outlined-select
popup menu colors do not change, but remain default.The text was updated successfully, but these errors were encountered: