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 select with 0 options positioning
Browse files Browse the repository at this point in the history
closes #1618
  • Loading branch information
rschmukler committed Feb 24, 2015
1 parent 20b6611 commit 5a82426
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/select/demoBasicUsage/script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
angular.module('selectDemoBasic', ['ngMaterial'])
.controller('AppCtrl', function($scope) {
$scope.neighborhoods = ['Chelsea', 'Financial District', 'Midtown', 'West Village', 'Williamsburg'];
$scope.neighborhoods = [];
$scope.neighborhoods2 = ['Chelsea', 'Financial District', 'Lower Manhattan', 'Midtown', 'Soho', 'Upper Manhattan', 'West Village', 'Williamsburg' ];
});
2 changes: 1 addition & 1 deletion src/components/select/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ function SelectProvider($$interimElementProvider) {
centeredNode = optionNodes[Math.floor(optionNodes.length / 2 )];
// In case there are no options, center on whatevers in there... (such as a progress indicator)
} else {
centeredNode = contentNode.firstElementChild;
centeredNode = contentNode.firstElementChild || contentNode;
}

if (contentNode.offsetWidth > maxWidth) {
Expand Down

0 comments on commit 5a82426

Please sign in to comment.