Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
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

Closed

Description

@jelbourn

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>

Button and input

Great. What happens if I put an md-button next to an md-input-container?
md-button and md-input

Okay, looks like the input container is display block. Let's just change that to inline-block:
md-button and md-input 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:
md-button and md-input 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.
md-button and md-input showing baseline

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.

Activity

  1. modified the milestone: on Jul 6, 2015
  2. modified the milestones: 0.11.0, on Aug 14, 2015
  3. tapas4java commented on Aug 18, 2015

    @tapas4java

    Are we on track for delevering this on 0.11.0 release?

  4. jelbourn commented on Sep 14, 2015

    @jelbourn
    ContributorAuthor

    Components to look at:
    button, input, autocomplete, datepicker, select, menu, checkbox, radio-button, chips, icon, switch, slider

  5. mattdanna commented on Nov 4, 2015

    @mattdanna

    @robertmesserle Has this been resolved?

    Edit: Ah, nvm. I just saw #4970 made it into master last week. Great success! 👍

  6. mallowigi commented on Nov 4, 2015

    @mallowigi
    Contributor

    So this is why my input containers are all messed up...

  7. christiaanwesterbeek commented on Sep 22, 2016

    @christiaanwesterbeek

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions