Skip to content

[V2] How to prevent button pre-selection on UModal? #3187

Closed as not planned
Closed as not planned
@Yves852

Description

@Yves852

Description

Hello.

With a modal when it opens the first button present is selected. Is there a way to change selection order or prevent it completely?
In exemple below the reset button is pre-selected.

I could reorder buttons instead but I would like no pre-selections instead and prevent users' "miss-click". Thanks.

    <UModal v-model="dialog" prevent-close>
      <UCard>
        <p>Reset data or continue?</p>

        <div class="flex justify-between">
          <UButton color="gray" variant="ghost" @click="reset">
            Delete current data
            <UIcon name="i-heroicons-x-mark-20-solid" class="text-red-600" />
          </UButton>

          <UButton color="gray" variant="ghost"  @click="continue">
           Continue
            <UIcon name="i-mdi-arrow-right-circle" class="text-primary" />
          </UButton>
        </div>
      </UCard>
    </UModal>

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedwontfix-v2This will not be fixed in `v2.x`.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions