This repository was archived by the owner on Sep 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ md-select-menu.md-THEME_NAME-theme {
64
64
}
65
65
}
66
66
}
67
- md-option :focus:not ([selected ]) {
67
+ md-option :focus:not ([disabled ]) :not ([ selected ]) {
68
68
background : ' {{background-200}}' ;
69
69
}
70
70
Original file line number Diff line number Diff line change @@ -1202,14 +1202,16 @@ function SelectProvider($$interimElementProvider) {
1202
1202
if ( ev && ( ev . type == 'mouseup' ) && ( ev . currentTarget != dropDown [ 0 ] ) ) return ;
1203
1203
if ( mouseOnScrollbar ( ) ) return ;
1204
1204
1205
- if ( ! selectCtrl . isMultiple ) {
1206
- opts . restoreFocus = true ;
1205
+ var option = $mdUtil . getClosest ( ev . target , 'md-option' ) ;
1206
+ if ( option && option . hasAttribute && ! option . hasAttribute ( 'disabled' ) ) {
1207
+ if ( ! selectCtrl . isMultiple ) {
1208
+ opts . restoreFocus = true ;
1207
1209
1208
- $mdUtil . nextTick ( function ( ) {
1209
- $mdSelect . hide ( selectCtrl . ngModel . $viewValue ) ;
1210
- } , true ) ;
1210
+ $mdUtil . nextTick ( function ( ) {
1211
+ $mdSelect . hide ( selectCtrl . ngModel . $viewValue ) ;
1212
+ } , true ) ;
1213
+ }
1211
1214
}
1212
-
1213
1215
/**
1214
1216
* check if the mouseup event was on a scrollbar
1215
1217
*/
Original file line number Diff line number Diff line change @@ -843,7 +843,7 @@ describe('<md-select>', function() {
843
843
if ( angular . isArray ( options ) ) {
844
844
$rootScope . $$values = options ;
845
845
var renderValueAs = compileOpts ? compileOpts . renderValueAs || 'value' : 'value' ;
846
- optionsTpl = '<md-option ng-repeat="value in $$values" ng-value="value">{{' + renderValueAs + '}}</md-option>' ;
846
+ optionsTpl = '<md-option ng-repeat="value in $$values" ng-value="value"><div class="md-text"> {{' + renderValueAs + '}}</div> </md-option>' ;
847
847
} else if ( angular . isString ( options ) ) {
848
848
optionsTpl = options ;
849
849
}
@@ -898,7 +898,7 @@ describe('<md-select>', function() {
898
898
function clickOption ( index ) {
899
899
inject ( function ( $rootScope , $document ) {
900
900
var openMenu = $document . find ( 'md-select-menu' ) ;
901
- var opt = $document . find ( 'md-option' ) [ index ] ;
901
+ var opt = angular . element ( $document . find ( 'md-option' ) [ index ] ) . find ( 'div' ) [ 0 ] ;
902
902
903
903
if ( ! openMenu . length ) throw Error ( 'No select menu currently open' ) ;
904
904
if ( ! opt ) throw Error ( 'Could not find option at index: ' + index ) ;
@@ -909,6 +909,7 @@ describe('<md-select>', function() {
909
909
} ) ;
910
910
angular . element ( openMenu ) . triggerHandler ( {
911
911
type : 'mouseup' ,
912
+ target : target ,
912
913
currentTarget : openMenu [ 0 ]
913
914
} ) ;
914
915
} ) ;
You can’t perform that action at this time.
0 commit comments