Skip to content

Commit

Permalink
feat(Input/Textarea): allow specifying autofocus delay for page trans…
Browse files Browse the repository at this point in the history
…itions (#816)
  • Loading branch information
acidjazz committed Oct 14, 2023
1 parent 550ac10 commit 8bfd359
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/runtime/components/forms/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ export default defineComponent({
type: Boolean,
default: false
},
autofocusDelay: {
type: Number,
default: 100,

Check failure on line 90 in src/runtime/components/forms/Input.vue

View workflow job for this annotation

GitHub Actions / ci (ubuntu-latest, 18)

Unexpected trailing comma
},
icon: {
type: String,
default: null
Expand Down Expand Up @@ -181,7 +185,7 @@ export default defineComponent({
onMounted(() => {
setTimeout(() => {
autoFocus()
}, 100)
}, props.autofocusDelay)
})
const inputClass = computed(() => {
Expand Down
6 changes: 5 additions & 1 deletion src/runtime/components/forms/Textarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export default defineComponent({
type: Boolean,
default: false
},
autofocusDelay: {
type: Number,
default: 100
},
resize: {
type: Boolean,
default: false
Expand Down Expand Up @@ -168,7 +172,7 @@ export default defineComponent({
onMounted(() => {
setTimeout(() => {
autoFocus()
}, 100)
}, props.autofocusDelay)
})
watch(() => props.modelValue, () => {
Expand Down

1 comment on commit 8bfd359

@vercel
Copy link

@vercel vercel bot commented on 8bfd359 Oct 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./

ui-nuxt-js.vercel.app
ui.nuxt.com
ui-git-dev-nuxt-js.vercel.app

Please sign in to comment.