We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 30b1bef commit 27d84f1Copy full SHA for 27d84f1
assets/plugins/features/confirm.ts
@@ -32,8 +32,13 @@ export class ConfirmPlugin implements DatagridPlugin {
32
onDatagridInit(datagrid: Datagrid): boolean {
33
this.datagrid = datagrid;
34
35
- const confirmElements = datagrid.el.querySelectorAll<HTMLElement>(`[${ConfirmAttribute}]:not(.ajax)`);
36
- confirmElements.forEach(el => el.addEventListener("click", e => this.handleClick(el, e)));
+ datagrid.el.addEventListener("click", e => {
+ const target = e.target as HTMLElement;
37
+ const confirmEl = target.closest<HTMLElement>(`[${ConfirmAttribute}]:not(.ajax)`);
38
+ if (confirmEl) {
39
+ this.handleClick(confirmEl, e);
40
+ }
41
+ });
42
43
datagrid.ajax.addEventListener("interact", e => {
44
const target = e.detail.element;
0 commit comments