Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(portals): check the grandparent element if it's dialog plugin #7240 #7243

Merged
merged 1 commit into from Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 27 additions & 1 deletion ui/dev/src/pages/global/dialog-component-no-parent.js
Expand Up @@ -7,7 +7,9 @@ export default {

data () {
return {
inc: 0
inc: 0,
sel: null,
options: [ 'Option 1', 'Option 2', 'Option 3', 'Option 4', 'Option 5' ]
}
},

Expand Down Expand Up @@ -43,6 +45,30 @@ export default {
'Custooom: ' + this.text
]),

h('q-card-section', [
h('q-select', {
props: {
label: 'Menu select',
color: 'accent',
options: this.options,
value: this.sel,
behavior: 'menu'
},
on: { input: val => { this.sel = val } }
}),

h('q-select', {
props: {
label: 'Dialog select',
color: 'accent',
options: this.options,
value: this.sel,
behavior: 'dialog'
},
on: { input: val => { this.sel = val } }
})
]),

h('q-card-section', [
'Reactivity:',

Expand Down
28 changes: 27 additions & 1 deletion ui/dev/src/pages/global/dialog-component-with-parent.js
Expand Up @@ -20,7 +20,9 @@ export default {

data () {
return {
inc: 0
inc: 0,
sel: null,
options: [ 'Option 1', 'Option 2', 'Option 3', 'Option 4', 'Option 5' ]
}
},

Expand Down Expand Up @@ -64,6 +66,30 @@ export default {
h('test-component')
]),

h('q-card-section', [
h('q-select', {
props: {
label: 'Menu select',
color: 'accent',
options: this.options,
value: this.sel,
behavior: 'menu'
},
on: { input: val => { this.sel = val } }
}),

h('q-select', {
props: {
label: 'Dialog select',
color: 'accent',
options: this.options,
value: this.sel,
behavior: 'dialog'
},
on: { input: val => { this.sel = val } }
})
]),

h('q-card-section', [
'Reactivity:',

Expand Down
6 changes: 5 additions & 1 deletion ui/src/mixins/portal.js
Expand Up @@ -136,7 +136,11 @@ export default {
},

created () {
this.__onGlobalDialog = this.$root.$options.name === 'QGlobalDialog'
// we cannot check the root component because
// we might have portals in portals (vue tree)
this.__onGlobalDialog = this.$parent !== void 0 &&
this.$parent.$parent !== void 0 &&
this.$parent.$parent.$options.name === 'QGlobalDialog'
},

beforeDestroy () {
Expand Down