-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1243 Prevent ENTER in text input elements to trigger submit
- Loading branch information
Showing
1 changed file
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,12 +23,8 @@ | |
* along with OPUS; if not, write to the Free Software Foundation, Inc., 51 | ||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
* @category Application | ||
* @author Sascha Szott <[email protected]> | ||
* @copyright Copyright (c) 2008-2012, OPUS 4 development team | ||
* @copyright Copyright (c) 2008, OPUS 4 development team | ||
* @license http://www.gnu.org/licenses/gpl.html General Public License | ||
* @version $Id$ | ||
* | ||
*/ | ||
|
||
$(function () { | ||
|
@@ -40,4 +36,12 @@ $(function () { | |
}); | ||
}); | ||
|
||
$('form').on('keydown', e => { | ||
if (e.key === 'Enter') { | ||
if ($(e.target).is("input[type='text']")) { | ||
e.preventDefault(); | ||
} | ||
} | ||
}); | ||
|
||
}); |