Skip to content

Commit

Permalink
fix: dup keyboard events
Browse files Browse the repository at this point in the history
  • Loading branch information
stid committed Jul 28, 2024
1 parent 70a3063 commit 7b57a6a
Show file tree
Hide file tree
Showing 5 changed files with 1,016 additions and 1,866 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"react-testing-library": "^8.0.1",
"tailwindcss": "^3.4.6",
"ts-jest": "^29.2.3",

"typescript": "^5.5.3"
},
"dependencies": {
Expand Down
2 changes: 0 additions & 2 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ const App = ({ worker }: Props): JSX.Element => {
e.preventDefault();
};

window.addEventListener('keydown', handleKeyDown);
const hiddenInput = hiddenInputRef.current;
if (hiddenInput) {
hiddenInput.addEventListener('keydown', handleKeyDown);
}

return () => {
window.removeEventListener('keydown', handleKeyDown);
if (hiddenInput) {
hiddenInput.removeEventListener('keydown', handleKeyDown);
}
Expand Down
3 changes: 1 addition & 2 deletions src/index-web.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import App from './components/App';
import { createRoot } from 'react-dom/client';
import { onCLS, onFID, onLCP } from 'web-vitals';
import { onCLS, onLCP } from 'web-vitals';

const createAppleWorker = (): Worker => {
return new Worker(new URL('./apple1/Apple.worker.ts', import.meta.url), { type: 'module' });
Expand All @@ -18,7 +18,6 @@ const renderApp = (worker: Worker) => {

const initWebVitals = () => {
onCLS(console.log);
onFID(console.log);
onLCP(console.log);
};

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const APP_VERSION = '2.3.0';
export const APP_VERSION = '2.3.1';
Loading

0 comments on commit 7b57a6a

Please sign in to comment.