1
0
Fork 0

Merge branch 'main' into prettier-trailing-comma

This commit is contained in:
Jascha Ezra Urbach 2023-10-17 19:31:24 +02:00 committed by GitHub
commit 4d352faae3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 69 additions and 14 deletions

View file

@ -47,12 +47,11 @@
.querySelectorAll("[data-remove]")
.forEach((node) => node.addEventListener("click", removeInput));
// Get the element, add a keypress listener...
// Get element, add a keypress listener...
document.getElementById("subjects").addEventListener("keypress", function (e) {
// e.target is the element where it listens!
// if e.target is input field within the "subjects" div, do stuff
// Linstening to element e.target
// If e.target is an input field within "subjects" div preventDefault()
if (e.target && e.target.nodeName == "INPUT") {
// Item found, prevent default
if (event.keyCode == 13) {
event.preventDefault();
}