Skip to content

Commit

Permalink
tests: Fix the script on the test page to properly refer to TextArea
Browse files Browse the repository at this point in the history
  • Loading branch information
pentamassiv committed Sep 9, 2024
1 parent 49e587a commit c02602e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ <h1>Conducted tests</h1>
<script>
// Focus on the textarea when the page loads
window.onload = () => {
const textArea = document.getElementById('text');
textArea.focus();
};

// Prevent other elements from gaining focus
document.addEventListener('focusin', (event) => {
const textArea = document.getElementById('text');
if (event.target !== textArea) {
event.preventDefault();
textArea.focus();
Expand Down

0 comments on commit c02602e

Please sign in to comment.