Skip to content

Commit

Permalink
Refactor on DomHandler's hasClass method
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Aug 8, 2022
1 parent bcdfef6 commit 4c7c30b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/lib/utils/DomHandler.js
Expand Up @@ -197,6 +197,7 @@ export default class DomHandler {
else
return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className);
}
return false;
}

static find(element, selector) {
Expand Down Expand Up @@ -747,7 +748,7 @@ export default class DomHandler {

static isVisible(element) {
// https://stackoverflow.com/a/59096915/502366 (in future use IntersectionObserver)
return element && (
return element && (
element.clientHeight !== 0 ||
element.getClientRects().length !== 0 ||
getComputedStyle(element).display !== 'none'
Expand Down Expand Up @@ -1035,4 +1036,4 @@ export default class DomHandler {
// Seem the same
return true;
}
}
}

0 comments on commit 4c7c30b

Please sign in to comment.