Skip to content

Commit 3225852

Browse files
msaelicesrigor789
authored andcommitted
fix(modals): no ActionBar when launched from a frame within a component (#558)
* fix: force modal to be opened in the root NS component, which fixes #536 * chore: no need to have the workaround code as the #536 issue is fixed
1 parent 12e5154 commit 3225852

File tree

2 files changed

+1
-50
lines changed

2 files changed

+1
-50
lines changed

platform/nativescript/plugins/modal-plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default {
8585
const modalPage = navEntryInstance.$mount().$el.nativeView
8686
updateDevtools()
8787

88-
this.$el.nativeView.showModal(modalPage, options)
88+
this.$root.nativeView.showModal(modalPage, options)
8989
})
9090
}
9191
}

samples/app/536.js

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -83,52 +83,3 @@ new Vue({
8383
</GridLayout>
8484
`
8585
}).$start()
86-
87-
// Working code. Please comment the previous Vue instance and
88-
// uncomment the following commented code in order to workaround the issue
89-
// The workaround is opening the modal in the root component
90-
/*
91-
const TabContentWorking = {
92-
template: `
93-
<GridLayout rows="auto, auto">
94-
<Label text="This is the home page." row="0" />
95-
<Button text="Open Wizard" row="1" @tap="emitOpenEvent" />
96-
</GridLayout>
97-
`,
98-
methods: {
99-
emitOpenEvent() {
100-
this.$emit('show')
101-
}
102-
}
103-
}
104-
105-
new Vue({
106-
components: {
107-
TabContentWorking
108-
},
109-
template: `
110-
<GridLayout rows="*">
111-
<TabView androidTabsPosition="bottom" iosIconRenderingMode="alwaysOriginal">
112-
<TabViewItem title="Tab1" textTransform="capitalize">
113-
<Frame id="main-frame">
114-
<Page class="page">
115-
<ActionBar title="#536" />
116-
<TabContentWorking @show="openModal" />
117-
</Page>
118-
</Frame>
119-
</TabViewItem>
120-
</TabView>
121-
</GridLayout>
122-
`,
123-
methods: {
124-
openModal () {
125-
// show the wizard in a modal, and make sure it is fullscreen.
126-
this.$showModal(WizardModal, {
127-
fullscreen: true
128-
}).then(res => {
129-
console.log('wizard completed with res', res)
130-
})
131-
}
132-
}
133-
}).$start()
134-
*/

0 commit comments

Comments
 (0)