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 empty attribute for selected not selecting options
Browse files Browse the repository at this point in the history
closes #2114
  • Loading branch information
rschmukler committed Jun 28, 2015
1 parent e9f5a99 commit 4f7af22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/select/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ function SelectDirective($mdSelect, $mdUtil, $mdTheming, $mdAria, $interpolate,

function setAriaLabel() {
var labelText = element.attr('placeholder');
if (!labelText) {
labelText = containerCtrl.element.find('label').text();
if (!labelText && containerCtrl && containerCtrl.label) {
labelText = containerCtrl.label.text();
}
$mdAria.expect(element, 'aria-label', labelText);
}
Expand Down Expand Up @@ -648,6 +648,7 @@ function OptionDirective($mdButtonInkRipple, $mdUtil) {
scope.$$postDigest(function() {
attr.$observe('selected', function(selected) {
if (!angular.isDefined(selected)) return;
if (typeof selected == 'string') selected = true;
if (selected) {
if (!selectCtrl.isMultiple) {
selectCtrl.deselect( Object.keys(selectCtrl.selected)[0] );
Expand Down

0 comments on commit 4f7af22

Please sign in to comment.