Skip to content

Commit 38142c7

Browse files
korylprincemarcosmoura
authored andcommitted
check if .md-ripple exists before removing it class (#270)
* check if .md-ripple exists (it doesn't if not using md-button) * fix indentation and active class
1 parent 1095691 commit 38142c7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/mdSnackbar/mdSnackbar.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@
6969
methods: {
7070
removeElement() {
7171
if (this.rootElement.contains(this.snackbarElement)) {
72-
this.snackbarElement.querySelector('.md-ripple').classList.remove('md-active');
72+
const activeRipple = this.snackbarElement.querySelector('.md-ripple.md-active');
73+
74+
if (activeRipple) {
75+
activeRipple.classList.remove('md-active');
76+
}
77+
7378
this.rootElement.removeChild(this.snackbarElement);
7479
}
7580
},

0 commit comments

Comments
 (0)