autofocus passphrase field in unlock view

This commit is contained in:
Joseph Montanaro 2022-12-19 20:45:26 -08:00
parent d77437cda8
commit 983d0e8639
2 changed files with 3 additions and 2 deletions

View File

@ -61,7 +61,8 @@ async fn handle(mut stream: TcpStream, app_handle: AppHandle) -> Result<(), Requ
app_handle.emit_all("credentials-request", &req)?; app_handle.emit_all("credentials-request", &req)?;
let window = app_handle.get_window("main").ok_or(RequestError::NoMainWindow)?; let window = app_handle.get_window("main").ok_or(RequestError::NoMainWindow)?;
window.show()?; window.unminimize()?;
// window.show()?;
window.set_focus()?; window.set_focus()?;
let mut buf = [0; 8192]; // it's what tokio's BufReader uses let mut buf = [0; 8192]; // it's what tokio's BufReader uses

View File

@ -28,5 +28,5 @@
<form action="#" on:submit|preventDefault="{unlock}"> <form action="#" on:submit|preventDefault="{unlock}">
<div class="text-gray-200">Enter your passphrase:</div> <div class="text-gray-200">Enter your passphrase:</div>
<input class="text-gray-200 bg-zinc-800" type="password" placeholder="correct horse battery staple" bind:value="{passphrase}" /> <input autofocus class="text-gray-200 bg-zinc-800" type="password" placeholder="correct horse battery staple" bind:value="{passphrase}" />
</form> </form>