Skip to content

Commit

Permalink
fix(minor): revert keybinding changes
Browse files Browse the repository at this point in the history
not sure why but i believe focus element is different in some cases which is causing keybinding to not work so reverted changes from #344.
  • Loading branch information
maharshivpatel committed Sep 19, 2024
1 parent 4f6e6c6 commit 4438560
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ export function useAttachKeyBindings() {
const handleKeyDown = async (e) => {
MainStore.isAltKey = e.altKey;
MainStore.isShiftKey = e.shiftKey;
if (!e.target.classList.contains("print-format-container") || MainStore.openModal) return;
if (
!(
e.target.classList.contains("print-format-container") || e.target == document.body
) ||
MainStore.openModal
)
return;
if (e.ctrlKey || e.metaKey) {
if (["a", "A"].indexOf(e.key) != -1) {
ElementStore.Elements.forEach((page) => {
Expand Down

0 comments on commit 4438560

Please sign in to comment.