Fixed #3691 - DataTable: cannot uncheck when click the checkbox in column

pull/3699/head
mertsincan 2023-03-02 12:34:02 +00:00
parent c623f45f25
commit c3370293cd
1 changed files with 17 additions and 14 deletions

View File

@ -578,21 +578,24 @@ export default {
},
isClickable(element) {
const targetNode = element.nodeName;
const parentNode = element.parentElement && element.parentElement.nodeName;
if (element) {
const targetNode = element.nodeName;
const parentNode = element.parentElement && element.parentElement.nodeName;
return (
targetNode == 'INPUT' ||
targetNode == 'BUTTON' ||
targetNode == 'A' ||
parentNode == 'INPUT' ||
parentNode == 'BUTTON' ||
parentNode == 'A' ||
this.hasClass(element, 'p-button') ||
this.hasClass(element.parentElement, 'p-button') ||
this.hasClass(element.parentElement, 'p-checkbox') ||
this.hasClass(element.parentElement, 'p-radiobutton')
);
return (
targetNode === 'INPUT' ||
targetNode === 'TEXTAREA' ||
targetNode === 'BUTTON' ||
targetNode === 'A' ||
parentNode === 'INPUT' ||
parentNode === 'TEXTAREA' ||
parentNode === 'BUTTON' ||
parentNode === 'A' ||
!!element.closest('.p-button, .p-checkbox, .p-radiobutton')
);
}
return false;
},
applyStyle(element, style) {