feat(ui): auto focus to sign in input
parent
f1cff0738a
commit
560f880448
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { DEFAULT_SERVER } from '~/constants'
|
import { DEFAULT_SERVER } from '~/constants'
|
||||||
|
|
||||||
|
const input = $ref<HTMLInputElement>()
|
||||||
let server = $ref<string>('')
|
let server = $ref<string>('')
|
||||||
|
|
||||||
async function oauth() {
|
async function oauth() {
|
||||||
|
@ -13,6 +14,10 @@ async function handleInput() {
|
||||||
if (server.startsWith('https://'))
|
if (server.startsWith('https://'))
|
||||||
server = server.replace('https://', '')
|
server = server.replace('https://', '')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
input?.focus()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -23,7 +28,7 @@ async function handleInput() {
|
||||||
<div>Mastodon Server Name</div>
|
<div>Mastodon Server Name</div>
|
||||||
<div flex bg-gray:10 px2 py1 mxa rounded border="~ border" text-xl items-center>
|
<div flex bg-gray:10 px2 py1 mxa rounded border="~ border" text-xl items-center>
|
||||||
<span text-secondary-light mr1 text-sm>https://</span>
|
<span text-secondary-light mr1 text-sm>https://</span>
|
||||||
<input v-model="server" :placeholder="DEFAULT_SERVER" outline-none bg-transparent @input="handleInput">
|
<input ref="input" v-model="server" :placeholder="DEFAULT_SERVER" outline-none bg-transparent @input="handleInput">
|
||||||
</div>
|
</div>
|
||||||
<button btn-solid mt2>
|
<button btn-solid mt2>
|
||||||
{{ $t('action.sign_in') }}
|
{{ $t('action.sign_in') }}
|
||||||
|
|
Loading…
Reference in New Issue