forked from angular/material
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix select pristine/dirty error and many styles.
_NOT READY FOR MERGE - Need to share with others to see improved UI functionality/styles and get sign-off._ Fix styles and code to follow pristine/dirty styling of other input elements and provide CSS class for stand-alone usage. - Select now behaves like a normal input, appearing as invalid if the user focuses/blurs the element, or submits the form, without selecting an option. - Fix issues with floating labels not working on focus. - Add new `md-no-underline` CSS class to allow for stand-alone usage (non-form). - Update demos to show new stand-alone usage. Fixes angular#8529. Fixes angular#7988.
- Loading branch information
1 parent
51f8a2a
commit 93de4d8
Showing
10 changed files
with
254 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,83 @@ | ||
<div ng-controller="AppCtrl as ctrl" class="md-padding" ng-cloak> | ||
<div> | ||
<h1 class="md-title">Enter an address</h1> | ||
<div layout="row"> | ||
|
||
<md-input-container> | ||
<label>Street Name</label> | ||
<input> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>City</label> | ||
<input> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>State</label> | ||
<md-select ng-model="ctrl.userState"> | ||
<md-option ng-repeat="state in ctrl.states" value="{{state.abbrev}}" ng-disabled="$index === 1"> | ||
{{state.abbrev}} | ||
</md-option> | ||
<div ng-controller="AppCtrl as ctrl" class="md-padding" ng-cloak layout="column"> | ||
|
||
<p> | ||
The <code><md-select></code> component can be used within a | ||
<code><md-input-container></code> or as a stand alone component by using the | ||
<code>md-no-underline</code> class. | ||
</p> | ||
|
||
<md-card> | ||
<md-card-title> | ||
<md-card-title-text> | ||
<span class="md-headline">Account Preferences</span> | ||
<span class="md-subhead">Tell us a little about you.</span> | ||
</md-card-title-text> | ||
</md-card-title> | ||
|
||
<md-card-content> | ||
<div layout="row"> | ||
<md-input-container> | ||
<label>Street Name</label> | ||
<input> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>City</label> | ||
<input> | ||
</md-input-container> | ||
|
||
<md-input-container> | ||
<label>State</label> | ||
<md-select ng-model="ctrl.userState"> | ||
<md-option ng-repeat="state in ctrl.states" value="{{state.abbrev}}" ng-disabled="$index === 1"> | ||
{{state.abbrev}} | ||
</md-option> | ||
</md-select> | ||
</md-input-container> | ||
</div> | ||
</md-card-content> | ||
</md-card> | ||
|
||
<md-card> | ||
<md-card-title> | ||
<md-card-title-text> | ||
<span class="md-headline">Battle Preferences</span> | ||
<span class="md-subhead">Choose wisely if you want to win.</span> | ||
</md-card-title-text> | ||
</md-card-title> | ||
|
||
<md-card-content> | ||
<div layout="row" layout-align="space-between center"> | ||
<span>What is your favorite weapon?</span> | ||
<md-select ng-model="weapon" placeholder="Choose..." class="md-no-underline"> | ||
<md-option value="axe">Axe</md-option> | ||
<md-option value="sword">Sword</md-option> | ||
<md-option value="wand">Wand</md-option> | ||
<md-option value="pen">Pen?</md-option> | ||
</md-select> | ||
</div> | ||
|
||
<div layout="row" layout-align="space-between center"> | ||
<span>What armor do you wear?</span> | ||
<md-select ng-model="armor" placeholder="Choose..." class="md-no-underline"> | ||
<md-option value="cloth">Cloth</md-option> | ||
<md-option value="leather">Leather</md-option> | ||
<md-option value="chain">Chainmail</md-option> | ||
<md-option value="plate">Plate</md-option> | ||
</md-select> | ||
</md-input-container> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div layout="row" layout-align="space-between center"> | ||
<span>How do you refresh your magic?</span> | ||
<md-select ng-model="drink" placeholder="Choose..." class="md-no-underline"> | ||
<md-option value="water">Water</md-option> | ||
<md-option value="juice">Juice</md-option> | ||
<md-option value="milk">Milk</md-option> | ||
<md-option value="wine">Wine</md-option> | ||
<md-option value="mead">Mead</md-option> | ||
</md-select> | ||
</div> | ||
</md-card-content> | ||
</md-card> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.