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

Commit 2760f67

Browse files
committed
fix(select): fix auto-complete element not being removed from form
closes #5575
1 parent 6bf98aa commit 2760f67

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/components/select/select.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,12 @@ function SelectDirective($mdSelect, $mdUtil, $mdTheming, $mdAria, $compile, $par
227227

228228
if (attr.name && formCtrl) {
229229
var selectEl = element.parent()[0].querySelector('select[name=".' + attr.name + '"]');
230-
var controller = angular.element(selectEl).controller();
231-
if (controller) {
232-
formCtrl.$removeControl(controller);
233-
}
230+
$mdUtil.nextTick(function() {
231+
var controller = angular.element(selectEl).controller('ngModel');
232+
if (controller) {
233+
formCtrl.$removeControl(controller);
234+
}
235+
});
234236
}
235237

236238
if (formCtrl) {

0 commit comments

Comments
 (0)