Fixed #586 - Dropdown inside datable using showClear causing: Cannot read property 'classList' of null

pull/590/head
Cagatay Civici 2020-10-21 13:58:07 +03:00
parent 9b9802d838
commit 41074b0e7e
1 changed files with 8 additions and 4 deletions

View File

@ -143,12 +143,16 @@ export default class DomHandler {
} }
static hasClass(element, className) { static hasClass(element, className) {
if (element) {
if (element.classList) if (element.classList)
return element.classList.contains(className); return element.classList.contains(className);
else else
return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className); return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className);
} }
return false;
}
static find(element, selector) { static find(element, selector) {
return element.querySelectorAll(selector); return element.querySelectorAll(selector);
} }