Skip to content

Commit

Permalink
Merge pull request #130 from nextcloud/fix/dont-close-viewer-on-escape
Browse files Browse the repository at this point in the history
stop propagation when Escape key pressed
  • Loading branch information
juliushaertl authored Sep 10, 2024
2 parents 4e6bd9e + 762f5a7 commit 94b7829
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ const Component = {
this.$nextTick(() => {
const rootElement = document.getElementById('whiteboard-' + randomId)
this.root = createRoot(rootElement)
rootElement.addEventListener('keydown', event => {
if (event.key === 'Escape') {
event.stopPropagation()
}
})

this.root.render(
<StrictMode>
Expand Down Expand Up @@ -70,6 +75,7 @@ if (typeof OCA.Viewer !== 'undefined') {
theme: 'default',
canCompare: true,
})

} else {
alert('UNDEFINED')
}

0 comments on commit 94b7829

Please sign in to comment.