Skip to content

Commit ea72fad

Browse files
13: Correcting getDefaultText to match description. This correct initial selection issue commented on by alex88 (Oct. 27, 2016)
1 parent 5ed9372 commit ea72fad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/dropdown/sm-dropdown.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@
135135
// in the items, the appropriate item's label is displayed. Otherwise return the default text.
136136
$scope.getDefaultText = function()
137137
{
138-
return ( $scope.isEmpty() ? $scope.defaultText : '' );
138+
var defaultText = $scope.defaultText ? $scope.defaultText : '';
139+
return ( $scope.isEmpty() ? defaultText : $scope.findMatchingItem($scope.model) );
139140
};
140141

141142
// Finds an item instance that has the exact same value as the given value.

0 commit comments

Comments
 (0)