Skip to content

Commit

Permalink
#1243 Prevent ENTER in text input elements to trigger submit
Browse files Browse the repository at this point in the history
  • Loading branch information
j3nsch committed Oct 21, 2024
1 parent ed281d8 commit 08e3871
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions public/layouts/opus4/js/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ $(function () {
});

$('form').on('keydown', e => {
if (e.key === 'Enter') {
if ($(e.target).is("input[type='text']")) {
e.preventDefault();
}
}
if (e.key === 'Enter') {
if ($(e.target).is("input[type='text']")) {
e.preventDefault();
}
}
});

});

0 comments on commit 08e3871

Please sign in to comment.