mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 19:11:09 +00:00
Merge pull request #3033 from bookwyrm-social/fix-eslint-warning
Fix eslint warning
This commit is contained in:
commit
66f62566d6
1 changed files with 3 additions and 4 deletions
|
@ -47,12 +47,11 @@
|
||||||
.querySelectorAll("[data-remove]")
|
.querySelectorAll("[data-remove]")
|
||||||
.forEach((node) => node.addEventListener("click", removeInput));
|
.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) {
|
document.getElementById("subjects").addEventListener("keypress", function (e) {
|
||||||
// e.target is the element where it listens!
|
// Linstening to element e.target
|
||||||
// if e.target is input field within the "subjects" div, do stuff
|
// If e.target is an input field within "subjects" div preventDefault()
|
||||||
if (e.target && e.target.nodeName == "INPUT") {
|
if (e.target && e.target.nodeName == "INPUT") {
|
||||||
// Item found, prevent default
|
|
||||||
if (event.keyCode == 13) {
|
if (event.keyCode == 13) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue