소스 검색

fix: unable to use cmd/ctrl-delete/backspace in inputs (#5348)

David Luzar 3 년 전
부모
커밋
50bc7e099a
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      src/components/App.tsx

+ 4 - 2
src/components/App.tsx

@@ -1731,11 +1731,13 @@ class App extends React.Component<AppProps, AppState> {
         });
       }
 
+      // bail if
       if (
+        // inside an input
         (isWritableElement(event.target) &&
-          !event[KEYS.CTRL_OR_CMD] &&
+          // unless pressing escape (finalize action)
           event.key !== KEYS.ESCAPE) ||
-        // case: using arrows to move between buttons
+        // or unless using arrows (to move between buttons)
         (isArrowKey(event.key) && isInputLike(event.target))
       ) {
         return;