File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
55## Unreleased
66
7+ ### Fixed
8+
9+ - Fix dialog not appearing when another modal is open
10+
711## 3.0.0 - 2022-09-07
812
913### Breaking
Original file line number Diff line number Diff line change @@ -2,26 +2,26 @@ msgid ""
22msgstr ""
33"Content-Type : text/plain; charset=UTF-8\n "
44
5- #: src/components/Dialog.vue:83
5+ #: src/components/Dialog.vue:84
66msgid "Authentication required"
77msgstr ""
88
9- #: src/components/Dialog.vue:87
9+ #: src/components/Dialog.vue:88
1010msgid "Confirm"
1111msgstr ""
1212
13- #: src/components/Dialog.vue:86
13+ #: src/components/Dialog.vue:87
1414msgid "Failed to authenticate, please try again"
1515msgstr ""
1616
17- #: src/components/Dialog.vue:85
17+ #: src/components/Dialog.vue:86
1818msgid "Password"
1919msgstr ""
2020
2121#: src/main.ts:21
2222msgid "Password confirmation dialog already mounted"
2323msgstr ""
2424
25- #: src/components/Dialog.vue:84
25+ #: src/components/Dialog.vue:85
2626msgid "This action requires you to confirm your password"
2727msgstr ""
Original file line number Diff line number Diff line change 3030 "@nextcloud/capabilities" : " ^1.0.4" ,
3131 "@nextcloud/l10n" : " ^1.6.0" ,
3232 "@nextcloud/router" : " ^2.0.0" ,
33- "@nextcloud/vue" : " ^7.0.0-beta.0 " ,
33+ "@nextcloud/vue" : " ^7.0.0-beta.2 " ,
3434 "vue" : " ^2.7.10"
3535 },
3636 "devDependencies" : {
Original file line number Diff line number Diff line change 2424 <NcModal :id =" dialogId"
2525 class =" dialog"
2626 size =" small"
27+ :container =" null"
2728 @close =" close" >
2829 <div class =" dialog__container" >
2930 <h2 class =" dialog__title" >{{ titleText }}</h2 >
Original file line number Diff line number Diff line change 11export const DIALOG_ID = 'password-confirmation-dialog'
2+ export const MODAL_CLASS = 'modal-mask' // NcModal component root class https://github.com/nextcloud/nextcloud-vue/blob/v7.0.0-beta.2/src/components/NcModal/NcModal.vue
Original file line number Diff line number Diff line change 11import Vue from 'vue'
22import DialogComponent from './components/Dialog.vue'
3- import { DIALOG_ID } from './globals.js'
3+ import { DIALOG_ID , MODAL_CLASS } from './globals.js'
44import { t } from './utils/l10n.js'
55
66import type { ComponentInstance } from 'vue'
@@ -27,7 +27,16 @@ export const confirmPassword = (): Promise<void> => {
2727
2828 const mountPoint = document . createElement ( 'div' )
2929 mountPoint . setAttribute ( 'id' , DIALOG_ID )
30- document . body . prepend ( mountPoint )
30+
31+ const modals = document . querySelectorAll ( `.${ MODAL_CLASS } ` )
32+ const isModalMounted = Boolean ( modals . length )
33+
34+ if ( isModalMounted ) {
35+ const previousModal = modals [ modals . length - 1 ]
36+ previousModal . prepend ( mountPoint )
37+ } else {
38+ document . body . prepend ( mountPoint )
39+ }
3140
3241 const DialogClass = Vue . extend ( DialogComponent )
3342 // Mount point element is replaced by the component
You can’t perform that action at this time.
0 commit comments