Issue Bug Closed

#87793Default submit in locked install tool reloads the form

Stephan Großberndt 02/26/19, 13:04 updated 04/01/20, 21:14

Description

In Firefox (at least on Ubuntu) when entering a password in the locked install tool and pressing enter the password is not sent to the server, instead the form is just reloaded. This is due to a check on keyCode in the javascript:

$(document).on('keydown', '#t3-install-form-password', function(e) {
  if (e.keyCode === 13) {
     e.preventDefault();
     $('.t3js-login-login').click();
   }

https://github.com/TYPO3/TYPO3.CMS/blob/f9ea59ca7275b4dbfa8b118fc3e5e44c65b90547/typo3/sysext/install/Resources/Public/JavaScript/Modules/Router.js#L44-L49

Instead of keydown keypress should be used and additionally e.which should be checked.

var code = e.keyCode || e.which;
 if(code == 13) { //Enter keycode
   //Do something
 }

Reviews 2