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

[Bug Report][3.6.14] v-menu in each row of v-data-table #20491

Closed
dombrga opened this issue Sep 19, 2024 · 1 comment
Closed

[Bug Report][3.6.14] v-menu in each row of v-data-table #20491

dombrga opened this issue Sep 19, 2024 · 1 comment

Comments

@dombrga
Copy link

dombrga commented Sep 19, 2024

Environment

Vuetify Version: 3.6.14
Vue Version: 3.4.36
Browsers: Edge 128.0.0.0
OS: Windows 10

Steps to reproduce

I provided a vuetify playground link for complete example.

The idea is that I want to put a menu (for actions like edit, delete, etc, that item in the table) in every row.
Problem is if I put a menu and click it, multiple menus will open, and they will be overlapping with each other. If you have 10 rows currently showing, 10 menus will show. So, if you try to close the menu, you will have to close 10 overlapping menus.
And the menu only opens for the first row.

Important bit

<template v-slot:item.actions="{ item  }">
  <v-btn id="menu-activator"> open menu </v-btn>
  <v-menu activator="#menu-activator">
    <v-list>
      <v-list-item>
        <v-icon class="me-2" size="small" @click="editItem(item)">
          mdi-pencil
        </v-icon>
      </v-list-item>
      <v-list-item>
        <v-icon size="small" @click="deleteItem(item)"> mdi-delete </v-icon>
      </v-list-item>
    </v-list>
  </v-menu>
</template>

Expected Behavior

Menu will open specifically for each row of v-data-table.

Actual Behavior

Menu opens only for the first row, and there will be multiple overlapping menus. The number of menus that will open depends on the rows currently showing in the table.

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

Thank you for any fix or recommendation anyone can provide!

@KaelWD
Copy link
Member

KaelWD commented Sep 19, 2024

Use one of the other ways of setting an activator (https://vuetifyjs.com/en/components/menus/#usage) or make sure you give each one a unique id.

@KaelWD KaelWD closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants