Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Yves852 opened this issue Jan 27, 2025 · 0 comments
Open

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

Yves852 opened this issue Jan 27, 2025 · 0 comments
Labels
question Further information is requested

Comments

@Yves852
Copy link

Yves852 commented Jan 27, 2025

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>
@Yves852 Yves852 added the question Further information is requested label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant