Skip to content

Commit cf8cbb2

Browse files
KaelWDjohnleider
authored andcommitted
fix(VMenu): ignore click outside if component is being destroyed (#8471)
fixes #6976 (cherry picked from commit f7682af)
1 parent 3f96592 commit cf8cbb2

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

packages/vuetify/src/components/VDialog/VDialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export default {
144144
// If the dialog content contains
145145
// the click event, or if the
146146
// dialog is not active
147-
if (!this.isActive || this.$refs.content.contains(e.target)) return false
147+
if (this._isDestroyed || !this.isActive || this.$refs.content.contains(e.target)) return false
148148

149149
// If we made it here, the click is outside
150150
// and is active. If persistent, and the

packages/vuetify/src/components/VMenu/VMenu.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ export default Vue.extend({
199199
},
200200
closeConditional (e) {
201201
return this.isActive &&
202+
!this._isDestroyed &&
202203
this.closeOnClick &&
203204
!this.$refs.content.contains(e.target)
204205
},

packages/vuetify/src/components/VNavigationDrawer/VNavigationDrawer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export default mixins(
256256
}
257257
},
258258
closeConditional () {
259-
return this.isActive && this.reactsToClick
259+
return this.isActive && !this._isDestroyed && this.reactsToClick
260260
},
261261
genDirectives () {
262262
const directives = [{

packages/vuetify/src/components/VSelect/VSelect.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ export default VTextField.extend({
275275
},
276276
closeConditional (e) {
277277
return (
278+
!this._isDestroyed &&
279+
278280
// Click originates from outside the menu content
279281
!!this.content &&
280282
!this.content.contains(e.target) &&

0 commit comments

Comments
 (0)