sciencefyll sciencefyll - 1 year ago 997
AngularJS Question

angular material md-input-container won't center vertically

I'm using angular material for designing my project. Now I want an input for searching in my toolbar, just like youtube.

My code:

<md-list flex-offset="10">
<md-list-item layout-align="start center">
<md-input-container md-no-float flex>
<input type="text" placeholder="Search" flex>
<md-button> test </md-button>

The toolbar tags before my md-list looks like this:

<md-toolbar layout="row" flex style="max-height: 60px;">
<div class="md-toolbar-tools">

What I've tried:

  • Wrapping it inside a normal div and setting layout-align to start, center.

  • Using a form tag to wrap the input container.


The input group won't center vertically, and this is what I'm after. Every other directive I've tried centers perfectly like the md-button.

Is this a bug or am I doing something wrong?

Edit (Added picture comparing, md-input-container, input, md-button):

enter image description here

Answer Source

Did You Tried

md-input-container .md-errors-spacer{
 min-height: 0px !important;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download