fix: Enter key reliably submits login form (#124)
The login form used 'return doLogin(event)' in onsubmit, but doLogin is async so it returns a Promise (truthy), which some browsers interpret as 'proceed with native form submit'. Changed to 'doLogin(event);return false' and added an explicit onkeydown Enter handler on the password input as belt-and-suspenders. Closes #124 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -82,8 +82,9 @@ button:hover{background:rgba(124,185,255,.25)}
|
||||
<div class="logo">H</div>
|
||||
<h1>Hermes</h1>
|
||||
<p class="sub">Enter your password to continue</p>
|
||||
<form onsubmit="return doLogin(event)">
|
||||
<input type="password" id="pw" placeholder="Password" autofocus>
|
||||
<form onsubmit="doLogin(event);return false">
|
||||
<input type="password" id="pw" placeholder="Password" autofocus
|
||||
onkeydown="if(event.key==='Enter'){doLogin(event);event.preventDefault();}">
|
||||
<button type="submit">Sign in</button>
|
||||
</form>
|
||||
<div class="err" id="err"></div>
|
||||
|
||||
Reference in New Issue
Block a user