Skip to content

Commit

Permalink
Add check for document.activeElement == INPUT before undo/redo (#3827)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jul 20, 2023
1 parent 45f48d8 commit de5b417
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/app-core/src/HistoryManagement/index.ts
Expand Up @@ -24,7 +24,8 @@ export function HistoryManagementMixin() {
// ctrl+shift+z or cmd+shift+z
(((e.ctrlKey || e.metaKey) && e.shiftKey && e.code === 'KeyZ') ||
// ctrl+y
(e.ctrlKey && !e.shiftKey && e.code === 'KeyY'))
(e.ctrlKey && !e.shiftKey && e.code === 'KeyY')) &&
document.activeElement?.tagName.toUpperCase() !== 'INPUT'
) {
self.history.redo()
}
Expand All @@ -33,7 +34,8 @@ export function HistoryManagementMixin() {
// ctrl+z or cmd+z
(e.ctrlKey || e.metaKey) &&
!e.shiftKey &&
e.code === 'KeyZ'
e.code === 'KeyZ' &&
document.activeElement?.tagName.toUpperCase() !== 'INPUT'
) {
self.history.undo()
}
Expand Down

0 comments on commit de5b417

Please sign in to comment.