viewer: prevent sidebar typing leak (fix #437)
parent
c9fc7c3c60
commit
6a37009b02
|
@ -1029,16 +1029,20 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
handleAppSidebarOpen() {
|
handleAppSidebarOpen() {
|
||||||
if (this.show && this.photoswipe) {
|
if (!(this.show && this.photoswipe)) return;
|
||||||
const sidebar: HTMLElement =
|
|
||||||
document.querySelector("aside.app-sidebar");
|
|
||||||
if (sidebar) {
|
|
||||||
this.sidebarWidth = sidebar.offsetWidth - 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.sidebarOpen = true;
|
const sidebar: HTMLElement = document.querySelector("aside.app-sidebar");
|
||||||
this.updateSizeWithoutAnim();
|
if (sidebar) {
|
||||||
|
this.sidebarWidth = sidebar.offsetWidth - 2;
|
||||||
|
|
||||||
|
// Stop sidebar typing from leaking to viewer
|
||||||
|
sidebar.addEventListener("keydown", (e) => {
|
||||||
|
if (e.key.length === 1) e.stopPropagation();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.sidebarOpen = true;
|
||||||
|
this.updateSizeWithoutAnim();
|
||||||
},
|
},
|
||||||
|
|
||||||
handleAppSidebarClose() {
|
handleAppSidebarClose() {
|
||||||
|
|
Loading…
Reference in New Issue