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

Commit

Permalink
fix(select): fix double label issue using placeholder in md-input-con…
Browse files Browse the repository at this point in the history
…tainer

references #2793
  • Loading branch information
rschmukler committed Jun 28, 2015
1 parent 044dbdc commit cbbb4b9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/input/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,12 @@ function placeholderDirective($log) {
element.removeAttr('placeholder');

if ( inputContainer.element.find('label').length == 0 ) {
var placeholder = '<label ng-click="delegateClick()">' + placeholderText + '</label>';
if (inputContainer.input && inputContainer.input[0].nodeName != 'MD-SELECT') {
var placeholder = '<label ng-click="delegateClick()">' + placeholderText + '</label>';

inputContainer.element.addClass('md-icon-float');
inputContainer.element.prepend(placeholder);
inputContainer.element.addClass('md-icon-float');
inputContainer.element.prepend(placeholder);
}
} else if (element[0].nodeName != 'MD-SELECT') {
$log.warn("The placeholder='" + placeholderText + "' will be ignored since this md-input-container has a child label element.");
}
Expand Down

0 comments on commit cbbb4b9

Please sign in to comment.