Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions adminforth/spa/src/components/ThreeDotsMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'opacity-50': checkboxes && checkboxes.length === 0 && item.meta?.disabledWhenNoCheckboxes,
'cursor-not-allowed': checkboxes && checkboxes.length === 0 && item.meta?.disabledWhenNoCheckboxes,
}"
@click="injectedComponentClick(i)"
@click="injectedComponentClick($event, i)"
>
<div class="wrapper" v-if="getCustomComponent(item)">
<component
Expand Down Expand Up @@ -172,10 +172,16 @@ function startBulkAction(actionId: string) {
showDropdown.value = false;
}

async function injectedComponentClick(index: number) {
function injectedComponentClick(e: MouseEvent, index: number) {
if (!e.isTrusted) return;

const componentRef = threeDotsDropdownItemsRefs.value[index];
if (componentRef && 'click' in componentRef) {
(componentRef as any).click?.();
if (componentRef) {
if (typeof (componentRef as any).click === 'function') {
(componentRef as any).click();
} else if (componentRef.$el && typeof componentRef.$el.click === 'function') {
componentRef.$el.click();
}
Comment on lines +180 to +184
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling componentRef.$el.click() from within the parent @click handler can synchronously dispatch a new click event that bubbles back to this same handler, potentially causing recursive re-entry (and double-triggering actions). Consider adding a re-entrancy guard (e.g., ignore non-user-triggered events via event.isTrusted / a local flag) or dispatch a non-bubbling event / trigger a more direct component method so the synthetic click doesn’t re-invoke injectedComponentClick.

Copilot uses AI. Check for mistakes.
}
showDropdown.value = false;
}
Expand Down