| Category | Sensors |
|---|---|
| Export Size | 704 B |
| Last Changed | 3 weeks ago |
Fires when users start typing on non-editable elements.
<input ref="input" type="text" placeholder="Start typing to focus" />
import { onStartTyping } from '@vueuse/core'
export default {
setup() {
const input = ref(null)
onStartTyping(() => {
if (!input.value.active)
input.value.focus()
})
return {
input,
}
},
}
/** * Fires when users start typing on non-editable elements. * * @see https://vueuse.org/onStartTyping * @param callback * @param options */ export declare function onStartTyping( callback: (event: KeyboardEvent) => void, options?: ConfigurableDocument ): void
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/core/onStartTyping/