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

Commit

Permalink
amend(select): fix bug introduced by accessability fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rschmukler committed Dec 3, 2015
1 parent 9dc98b9 commit 72fc318
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/components/select/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,13 @@ function SelectDirective($mdSelect, $mdUtil, $mdTheming, $mdAria, $compile, $par

// Use everything that's left inside element.contents() as the contents of the menu
var multiple = angular.isDefined(attr.multiple) ? 'multiple' : '';
var modelBinding = angular.isDefined(attr.ngModel) ? 'ng-model="' + attr.ngModel + '"' : '';
var selectTemplate = '' +
'<div class="md-select-menu-container" aria-hidden="true">' +
'<md-select-menu {0}>{1}</md-select-menu>' +
'<md-select-menu {0} {1}>{2}</md-select-menu>' +
'</div>';

selectTemplate = $mdUtil.supplant(selectTemplate, [multiple, element.html()]);
selectTemplate = $mdUtil.supplant(selectTemplate, [multiple, modelBinding, element.html()]);
element.empty().append(valueEl);
element.append(selectTemplate);

Expand Down
2 changes: 1 addition & 1 deletion src/components/select/select.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ describe('<md-select>', function() {
}));


it('removing a valid value from the model deselects its option', inject(function($rootScope) {
iit('removing a valid value from the model deselects its option', inject(function($rootScope) {
$rootScope.model = [2,3];
var el = setupMultiple('ng-model="$root.model"', [1,2,3,4]);

Expand Down

0 comments on commit 72fc318

Please sign in to comment.