Skip to content

Commit

Permalink
fix: added check visibility for the parent of the svg element
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksey28 committed Dec 27, 2021
1 parent 2e82a3f commit 91c4392
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/client/core/utils/shared/visibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ export function isElementVisible (el: Node): boolean {
return optionVisibleIndex >= topVisibleIndex && optionVisibleIndex <= bottomVisibleIndex;
}

if (adapter.dom.isSVGElement(el))
return adapter.style.get(el, 'visibility') !== 'hidden' && adapter.style.get(el, 'display') !== 'none';
if (adapter.dom.isSVGElement(el)) {
if (adapter.style.get(el, 'visibility') === 'hidden' || adapter.style.get(el, 'display') === 'none')
return false;

const parent = adapter.dom.findParent(el);

return parent ? isElementVisible(parent) : true;
}

return hasDimensions(el as HTMLElement) && adapter.style.get(el, 'visibility') !== 'hidden';
}

0 comments on commit 91c4392

Please sign in to comment.