fix: (regression 0.30.0) login dialog not working when using the "continue" button

Massimo Melina committed Feb 10, 2023 at 14:02 UTC 79da5c4237668611e3d9937d67216f865c2d9f00
1 file changed +7 -2
frontend/src/login.ts
+7 -2
@@ -60,7 +60,12 @@ export async function loginDialog(navigate: ReturnType<typeof useNavigate>) {
60 useEffect(() => {
61 setTimeout(() => usrRef.current?.focus()) // setTimeout workarounds problem due to double-mount while in dev
62 }, [])
63 - return h('form', {},
63 + return h('form', {
64 + onSubmit(ev:any) {
65 + ev.preventDefault()
66 + go()
67 + }
68 + },
69 h('div', { className: 'field' },
70 h('label', { htmlFor: 'username' }, "Username"),
71 h('input', {
@@ -83,7 +88,7 @@ export async function loginDialog(navigate: ReturnType<typeof useNavigate>) {
88 }),
89 ),
90 h('div', { style: { textAlign: 'right' } },
86 - h('button', { onClick: go }, "Continue")),
91 + h('button', { type: 'submit' }, "Continue")),
92 )
93
94 function onKeyDown(ev: KeyboardEvent) {