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.

mdAutocomplete: floating label input padding too large #5764

Closed

Description

@mckenzielong

The padding on md-autocomplete does not match other input sizes. See an example here: http://codepen.io/mckenzielong/pen/RWvxQv The text and select boxes have equal spacing, and the md-autocomplete is just slightly larger.

This was introduced after a fix to correct the placement of the progress bar: 44d1636

Browser

Opera 33 (Chrome 46) Windows 7, BB10.3.2 webkit

Reproduce

See this code pen: http://codepen.io/mckenzielong/pen/RWvxQv

Suggested fix

Haven't looked at the scss, but only the generated css file... probably isn't this straight forward: remove the 26px padding-bottom and adjust the bottom to be 16px instead of 40px.

Activity

  1. epelc commented on Nov 16, 2015

    @epelc
    Contributor

    +1 combined autocomplete height is 94px vs 70px for a regular md-input-container(with text input).

    Looks like this line needs to remove the + $input-error-height. My guess is this means special handling for ng-messages is required though. I suspect somehow the padding/margin need to merge a bit so that we can keep that 24px in the padding for ng-messages.

    padding-bottom: $input-container-padding + $input-error-height;

    A simple fix for now(if you aren't using ng-messages) is to add the following to your scss.

    md-autocomplete[md-floating-label] md-input-container {
        padding-bottom: 2px;
    }
    
  2. devversion commented on Nov 18, 2015

    @devversion
    Member

    Yes @epelc.

    I'm trying to understand the current behavior of the autocomplete directive.

      &[md-floating-label] {
        border-radius: 0;
        background: transparent;
        height: auto;
    
        md-input-container {
          padding-bottom: $input-container-padding + $input-error-height;
    
          // When we have ng-messages, remove the input error height from our bottom padding, since the
          // ng-messages wrapper has a min-height of 1 error (so we don't adjust height as often; see
          // input.scss file)
          &.md-input-has-messages {
            padding-bottom: $input-container-padding;
          }
        }
    

    But as we can see there is ngMessage already handled. So why is there the error height added. Does a normal autocomplete without ngMessage support error messages?

  3. pmchugh3 commented on Nov 18, 2015

    @pmchugh3

    +1. Have noticed some inconsistencies in the heights of the autocomplete, select and inputs which means we have had to fiddle with CSS to get the padding correct.

  4. devversion commented on Nov 18, 2015

    @devversion
    Member

    Yeah the problem is definitely the floating label at the autocomplete.
    (&[md-floating-label] md-input-container)

    I'm currently hanging on the $input-error-height. It was placed by sense, so we can't remove it without thinking

  5. mattdanna commented on Dec 7, 2015

    @mattdanna

    Probably worth mentioning here that not only is the label positioning off, but also the input text.

    black = Material Design spec
    red = current ngMaterial implementation (1.0.0-RC6)
    image

    While aesthetically insignificant on an individual component, when the elements of multiple components' in a form are not aligned, it makes the page look unpolished.

  6. added
    in progress
    P4: minor
    and removed
    in progress
    on Jan 15, 2016
  7. modified the milestone: on Jan 15, 2016
  8. modified the milestones: , Deprecated on Apr 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4: minor

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions