Barring any user programming errors, a component using NcModal in a similar manner to that shown in the Nextcloud Vue style guide will not cause any unhandled framework errors to be thrown when the modal dialog is shown.
Actual behavior
When the minimum reproducible example that follows is compiled and rendered, the dialog is shown when the 'Show Modal' button is clicked, as expected, but a runtime error is logged in the browser:
[Vue warn]: Error in nextTick: "TypeError: trapStack.indexOf is not a function"
found in
---> <NcModal>
<TestComponent> at src/components/test/TestComponent.vue
<TestView> at src/views/TestView.vue
<TestApp> at src/views/TestApp.vue
<NcAppContent>
<NcContent>
<Root> [vue.runtime.esm.js:4605](webpack:///inventory/node_modules/vue/dist/vue.runtime.esm.js)
VueJS 9
useFocusTrap NcModal.js:2
mounted NcModal.js:2
VueJS 19
doShowModal TestComponent.vue:10
VueJS 33
TypeError: trapStack.indexOf is not a function
activateTrap focus-trap.esm.js:65
addListeners focus-trap.esm.js:578
finishActivation focus-trap.esm.js:647
activate focus-trap.esm.js:656
node_modules NextJS
VueJS 5
useFocusTrap NcModal.js:2
mounted NcModal.js:2
VueJS 19
doShowModal TestComponent.vue:10
VueJS 33
The same error is also thrown when the dialog's close button is clicked, however the close button / doCancel method works as expected and causes the modal to be closed. In my use case, these errors do not appear to impact the behavior of the component / app.
Expected behavior
Barring any user programming errors, a component using
NcModal
in a similar manner to that shown in the Nextcloud Vue style guide will not cause any unhandled framework errors to be thrown when the modal dialog is shown.Actual behavior
When the minimum reproducible example that follows is compiled and rendered, the dialog is shown when the 'Show Modal' button is clicked, as expected, but a runtime error is logged in the browser:
The same error is also thrown when the dialog's close button is clicked, however the close button /
doCancel
method works as expected and causes the modal to be closed. In my use case, these errors do not appear to impact the behavior of the component / app.Minimum example to reproduce
Potentially relevant bits from
package.json
for my project: