fix(products): open one row menu so edit and other actions run
Desktop and mobile dropdowns shared an id, so both opened and the extra menu closed the click before the action. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -411,25 +411,25 @@ onMounted(load);
|
|||||||
</td>
|
</td>
|
||||||
<td class="ops" @click.stop>
|
<td class="ops" @click.stop>
|
||||||
<UiDropdownMenu
|
<UiDropdownMenu
|
||||||
:open="menuId === p.id"
|
:open="menuId === `d:${p.id}`"
|
||||||
align="end"
|
align="end"
|
||||||
@update:open="(v) => (menuId = v ? p.id : null)"
|
@update:open="(v) => (menuId = v ? `d:${p.id}` : null)"
|
||||||
>
|
>
|
||||||
<template #trigger="{ toggle }">
|
<template #trigger="{ toggle }">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="icon-btn"
|
class="more"
|
||||||
aria-label="عملیات"
|
aria-label="عملیات"
|
||||||
@click.stop="toggle"
|
@click.stop="toggle"
|
||||||
>
|
>
|
||||||
<UiIcon name="dots" :size="16" />
|
<UiIcon name="dots-v" :size="16" />
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
<button type="button" @click="goEdit(p.id)">ویرایش</button>
|
<button type="button" @click.stop="goEdit(p.id)">ویرایش</button>
|
||||||
<button type="button" @click="toggleActive(p)">
|
<button type="button" @click.stop="toggleActive(p)">
|
||||||
{{ p.isActive ? 'غیرفعال کردن' : 'فعال کردن' }}
|
{{ p.isActive ? 'غیرفعال کردن' : 'فعال کردن' }}
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="danger" @click="removeProduct(p)">حذف</button>
|
<button type="button" class="danger" @click.stop="removeProduct(p)">حذف</button>
|
||||||
</UiDropdownMenu>
|
</UiDropdownMenu>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -460,25 +460,25 @@ onMounted(load);
|
|||||||
</div>
|
</div>
|
||||||
<div class="mob-side">
|
<div class="mob-side">
|
||||||
<UiDropdownMenu
|
<UiDropdownMenu
|
||||||
:open="menuId === p.id"
|
:open="menuId === `m:${p.id}`"
|
||||||
align="end"
|
align="end"
|
||||||
@update:open="(v) => (menuId = v ? p.id : null)"
|
@update:open="(v) => (menuId = v ? `m:${p.id}` : null)"
|
||||||
>
|
>
|
||||||
<template #trigger="{ toggle }">
|
<template #trigger="{ toggle }">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="icon-btn"
|
class="more"
|
||||||
aria-label="عملیات"
|
aria-label="عملیات"
|
||||||
@click.stop="toggle"
|
@click.stop="toggle"
|
||||||
>
|
>
|
||||||
<UiIcon name="dots-v" :size="16" />
|
<UiIcon name="dots-v" :size="16" />
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
<button type="button" @click="goEdit(p.id)">ویرایش</button>
|
<button type="button" @click.stop="goEdit(p.id)">ویرایش</button>
|
||||||
<button type="button" @click="toggleActive(p)">
|
<button type="button" @click.stop="toggleActive(p)">
|
||||||
{{ p.isActive ? 'غیرفعال کردن' : 'فعال کردن' }}
|
{{ p.isActive ? 'غیرفعال کردن' : 'فعال کردن' }}
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="danger" @click="removeProduct(p)">حذف</button>
|
<button type="button" class="danger" @click.stop="removeProduct(p)">حذف</button>
|
||||||
</UiDropdownMenu>
|
</UiDropdownMenu>
|
||||||
<UiBadge :variant="p.isActive ? 'success' : 'neutral'" size="sm" dot>
|
<UiBadge :variant="p.isActive ? 'success' : 'neutral'" size="sm" dot>
|
||||||
{{ p.isActive ? 'فعال' : 'غیرفعال' }}
|
{{ p.isActive ? 'فعال' : 'غیرفعال' }}
|
||||||
@@ -680,6 +680,22 @@ tr:last-child td {
|
|||||||
.ops {
|
.ops {
|
||||||
width: 64px;
|
width: 64px;
|
||||||
}
|
}
|
||||||
|
.more {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border: 0;
|
||||||
|
background: none;
|
||||||
|
color: #94a3b8;
|
||||||
|
border-radius: var(--radius);
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.more:hover {
|
||||||
|
background: var(--accent-soft);
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
.mob-list {
|
.mob-list {
|
||||||
display: none;
|
display: none;
|
||||||
gap: 0.65rem;
|
gap: 0.65rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user