Skip to content

The input box in the modal will automatically gain focus #3062

Open
@Jevin0

Description

Environment

nuxt: 3.15.1

Version

v2.20.0

Reproduction

Description

<UModal>
  <UInput v-model="state.name" placeholder=".." />
  <UInput v-model="state.name1" placeholder="..." />
</UModal>

When a modal contains one or more input boxes, the first input box will always get focus automatically.
If I manually add a close button in the upper right corner, it will trigger a validation when I click it. This is not good. How can I avoid the input box getting focus when opening the modal?

Additional context

Image

Logs

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions