mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2025-08-06 05:46:28 +00:00
onKeyDown to reject events except from canvas
This commit is contained in:
@@ -752,6 +752,8 @@ export default class ExcalidrawView extends TextFileView {
|
||||
key: "abc",
|
||||
tabIndex: 0,
|
||||
onKeyDown: (e:any) => {
|
||||
//@ts-ignore
|
||||
if(e.target === excalidrawDiv.ref.current) return; //event should originate from the canvas
|
||||
if(document.fullscreenEnabled && document.fullscreenElement == this.contentEl && e.keyCode==27) {
|
||||
document.exitFullscreen();
|
||||
this.zoomToFit();
|
||||
|
||||
Reference in New Issue
Block a user