You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Components should have sensible CSS display on the outermost element. #3234
Right now, every component looks great when you're just using that component. However, if you try to start combining them, it quickly turns into a huge CSS pain.
As an example, let's look at something I tried to do: putting an <md-button> next to an <md-input-container>. If I were to do this with native elements, it would look like this:
<button>Hello</button><input>
Great. What happens if I put an md-button next to an md-input-container?
Okay, looks like the input container is display block. Let's just change that to inline-block: .
That's closer, but now the label is all messed up. I guess I'll just inspect the element and see what's going on... and discover that the input container display is actually flex. So, maybe we can fix the original problem by making in inline-flex:
An hour later, I'm reading the spec for how baselines are computed for flex containers. Turns out that the baseline for the label is computed based on the its raised position, rather than its down position, and the baseline for the flex-container as a whole is computed based on its first flex-item.
This issue isn't about this problem with the input; it's about making sure all of the components are doing something sensible and will mostly "just work" with other Material and native elements. Users should be able to interact with MD components as closely as possible to their native counterparts.
If you arrived here because you discovered that the layout of an md-autocomplete is pretty different from an md-select in an md-input-container. The md-floating-label attribute comes to the rescue. Check out the Floating label example on https://material.angularjs.org/1.0.1/demo/autocomplete
Activity
tapas4java commentedon Aug 18, 2015
Are we on track for delevering this on 0.11.0 release?
jelbourn commentedon Sep 14, 2015
Components to look at:
button, input, autocomplete, datepicker, select, menu, checkbox, radio-button, chips, icon, switch, slider
mattdanna commentedon Nov 4, 2015
@robertmesserle Has this been resolved?
Edit: Ah, nvm. I just saw #4970 made it into master last week. Great success! 👍
mallowigi commentedon Nov 4, 2015
So this is why my input containers are all messed up...
christiaanwesterbeek commentedon Sep 22, 2016
If you arrived here because you discovered that the layout of an
md-autocompleteis pretty different from anmd-selectin anmd-input-container. Themd-floating-labelattribute comes to the rescue. Check out the Floating label example on https://material.angularjs.org/1.0.1/demo/autocomplete