Skip to content

Commit

Permalink
resolved input focus
Browse files Browse the repository at this point in the history
  • Loading branch information
daimessdn committed Mar 11, 2021
1 parent 562a10b commit f3207ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ const triggerNotification = (text, finalText) => {
gameNotification.textContent = text;
setTimeout(() => { gameNotification.textContent = finalText; }, 5000);
};
window.onclick = () => {
feedInput.focus();
};
// pause game function
const pauseGame = () => {
game.isPaused = game.isPaused ? false : true;
Expand Down
4 changes: 1 addition & 3 deletions src/ts/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,7 @@ const triggerNotification = (text: string, finalText: string) => {
};

window.onclick = () => {
if (document.activeElement !== feedInput) {
feedInput.focus();
}
feedInput.focus()
}

// pause game function
Expand Down

0 comments on commit f3207ef

Please sign in to comment.