-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix addEventListener error #44
Comments
ChatGPT suggested: It seems like there might be an issue with the event listener for the "keyup" event on the promptInput element. Let's troubleshoot and improve the handling of the "Enter" key. Here's an updated version of your code:
_Changes made: I changed the event from "keyup" to "keydown" to ensure the event fires when the key is initially pressed. I added e.preventDefault(); to the handleEnterKey function to prevent the default behavior of the "Enter" key, which might include submitting a form and causing a page refresh. Try this updated code, and it should handle the "Enter" key more reliably._ |
Lighthouse error:
Affected code
The text was updated successfully, but these errors were encountered: