2017-05-30 8 views
1

角丸ダーツ素材コンポーネントの一部には、入力エレメントの上にある浮動ラベルが付いています。これは、例えばでは有効になって角ダーツ素材ドロップダウンの上にフローティングラベルを追加する方法

input with label

次の構文:

<material-input type="number" floatingLabel label="Label text"></material-input> 

私は今、材料、ドロップダウン選択のために同じことをしたいと思うが、それは、この機能を提供していないようです。質問は、私はこのベストをどのように実装するのですか?

dropdown without label

+0

のように見えるこれは、私が好きな角度jsのための同様のソリューションです。 https://stackoverflow.com/questions/37347018/how-to-add-floating-label-for-md-datepicker-in-angular-material-design – Fabian

+0

https://github.com/dart-lang/も参照してください。 angular_components/issue s/71 –

答えて

0

私は今、次のCSSコードを思い付いた:

.dropdown_with_label { 
    display: flex; 
    flex-direction: column; 
    margin-bottom: 16px; 
} 
.dropdown_with_label > span { 
    font-size: 12px; 
    white-space: nowrap; 
    text-overflow: ellipsis; 
    color: rgba(0, 0, 0, 0.54); 
    display: inline-block; 
    padding-bottom: 10px; 
} 

とhtmlがこの

<div class="dropdown_with_label"> 
    <span>Title</span> 
    <material-dropdown-select [buttonText]="foo" 
     <div header> 
      <material-select-searchbox 
       label="Search..." 
       [filterable]="bar"> 
      </material-select-searchbox> 
     </div> 
    </material-dropdown-select> 
</div> 
関連する問題