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 error when removing node on route change
Browse files Browse the repository at this point in the history
closes #2481
  • Loading branch information
rschmukler committed Apr 23, 2015
1 parent d65edce commit 9d76187
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/select/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,9 @@ function SelectProvider($$interimElementProvider) {
return $mdUtil.transitionEndPromise(element, { timeout: 350 }).then(function() {
element.removeClass('md-active');
opts.backdrop && opts.backdrop.remove();
opts.parent[0].removeChild(element[0]); // use browser to avoid $destroy event
if (element[0].parentNode === opts.parent[0]) {
opts.parent[0].removeChild(element[0]); // use browser to avoid $destroy event
}
if (opts.disableParentScroll) {
opts.restoreScroll();
}
Expand Down

0 comments on commit 9d76187

Please sign in to comment.