Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
feat(input): Add right-side icon to input container
Browse files Browse the repository at this point in the history
Fixes #4763. Closes #4808.
  • Loading branch information
programmist authored and ThomasBurleson committed Oct 6, 2015
1 parent dd90be8 commit d49d8dc
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/app/img/icons/ic_card_giftcard_24px.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/app/img/icons/ic_euro_24px.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion src/components/input/demoIcons/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<br/>
<md-content layout-padding class="autoScroll">

<md-input-container class="md-icon-float" >
<md-input-container class="md-icon-float">
<!-- Use floating label instead of placeholder -->
<label>Name</label>
<md-icon md-svg-src="img/icons/ic_person_24px.svg" class="name"></md-icon>
Expand All @@ -26,6 +26,13 @@
<input ng-model="user.address" type="text" placeholder="Address" >
</md-input-container>

<md-input-container class="md-icon-float md-icon-right">
<label>Donation Amount</label>
<md-icon md-svg-src="img/icons/ic_card_giftcard_24px.svg"></md-icon>
<input ng-model="user.donation" type="number" step="0.01">
<md-icon md-svg-src="img/icons/ic_euro_24px.svg"></md-icon>
</md-input-container>

</md-content>

</div>
3 changes: 2 additions & 1 deletion src/components/input/demoIcons/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ angular
name: 'John Doe',
email: '',
phone: '',
address: 'Mountain View, CA'
address: 'Mountain View, CA',
donation: 19.99
};
});
11 changes: 11 additions & 0 deletions src/components/input/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,17 @@ md-input-container.md-icon-float {

}

md-input-container.md-icon-right {
input {
margin-right: $icon-offset;
+ md-icon {
top: 26px;
right: 2px;
margin-right: 0;
}
}
}

@media screen and (-ms-high-contrast: active) {
md-input-container.md-default-theme > md-icon {
fill: #fff;
Expand Down

0 comments on commit d49d8dc

Please sign in to comment.