Skip to content

Commit

Permalink
stop propagation when Escape key pressed
Browse files Browse the repository at this point in the history
Signed-off-by: grnd-alt <salimbelakkaf@outlook.de>
  • Loading branch information
grnd-alt committed Sep 2, 2024
1 parent a9cbe97 commit 05548fb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ const Component = {
this.$nextTick(() => {
const rootElement = document.getElementById('whiteboard-' + randomId)
this.root = createRoot(rootElement)
rootElement.addEventListener('keydown', event => {
if (event.key === 'Escape') {
event.stopPropagation()
return

Check failure on line 27 in src/main.tsx

View workflow job for this annotation

GitHub Actions / NPM lint

Unnecessary return statement
}
})

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

} else {
alert('UNDEFINED')
}

0 comments on commit 05548fb

Please sign in to comment.