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

Commit

Permalink
fix(input): smart icon support should notice other input tags too
Browse files Browse the repository at this point in the history
Fixes #6977
  • Loading branch information
devversion committed Feb 2, 2016
1 parent 4fb92e3 commit 6153b06
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/input/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ angular.module('material.components.input', [
* </hljs>
*/
function mdInputContainerDirective($mdTheming, $parse) {

var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'MD-SELECT'];

return {
restrict: 'E',
link: postLink,
Expand All @@ -71,8 +74,8 @@ function mdInputContainerDirective($mdTheming, $parse) {
var next = icons[0].nextElementSibling;
var previous = icons[0].previousElementSibling;

element.addClass(next && next.tagName === 'INPUT' ? 'md-icon-left' :
previous && previous.tagName === 'INPUT' ? 'md-icon-right' : '');
element.addClass(next && INPUT_TAGS.indexOf(next.tagName) != -1 ? 'md-icon-left' :
previous && INPUT_TAGS.indexOf(previous.tagName) != -1 ? 'md-icon-right' : '');
}
// In case there are two icons we apply both icon classes
else if (icons.length == 2) {
Expand Down

0 comments on commit 6153b06

Please sign in to comment.