Skip to content

Commit b1f8090

Browse files
Veszter-007Copilot
andauthored
Confirm is valid for the given grid, not global. (#1205)
* Confirm is valid for the given grid, not global. * Update confirm.ts Confirm is valid for the given grid, not global. * Update assets/plugins/features/confirm.ts Hi there! Apologies for the delay in getting back to this — I’ve been a bit tied up lately. Thanks a lot for the suggested change. I’ve reviewed it and it looks great to me. I’ve committed the update and tested it on my end, and everything seems to be working fine. Let me know if there’s anything else I should adjust! Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent d730552 commit b1f8090

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

assets/plugins/features/confirm.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ export class ConfirmPlugin implements DatagridPlugin {
88
datagrid.el
99
.querySelectorAll<HTMLElement>(`[${ConfirmAttribute}]:not(.ajax)`)
1010
.forEach(confirmEl =>
11-
confirmEl.addEventListener("click", e => this.confirmEventHandler.bind(datagrid)(e.target as HTMLElement, e))
11+
confirmEl.addEventListener("click", e => this.confirmEventHandler.call(datagrid, e.target as HTMLElement, e))
1212
);
1313

14-
datagrid.ajax.addEventListener("interact", e => this.confirmEventHandler.bind(datagrid)(e.detail.element, e));
14+
datagrid.ajax.addEventListener("interact", e => {
15+
if (datagrid.el.contains(e.detail.element)) {
16+
this.confirmEventHandler.call(datagrid, e.detail.element, e);
17+
}
18+
});
1519

1620
return true;
1721
}

0 commit comments

Comments
 (0)