Merge pull request #754 from thiagocferr/741-Dislike-Numbers-in-Shorts-disappears-when

HOTFIX: added aditional check for like/dislike buttons inside ACTIVE …
This commit is contained in:
Dmitrii Selivanov authored and GitHub committed 2022-09-21 12:49:37 +02:00
commit 8f88f9203f
2 files changed
+6

No files matched your search

@@ -58,6 +58,9 @@ function isInViewport(element) {
const height = innerHeight || document.documentElement.clientHeight;
const width = innerWidth || document.documentElement.clientWidth;
return (
// When short (channel) is ignored, the element (like/dislike AND short itself) is
// hidden with a 0 DOMRect. In this case, consider it outside of Viewport
!(rect.top == 0 && rect.left == 0 && rect.bottom == 0 && rect.right == 0) &&
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= height &&
+3
View File
@@ -87,6 +87,9 @@ function isInViewport(element) {
const height = innerHeight || document.documentElement.clientHeight;
const width = innerWidth || document.documentElement.clientWidth;
return (
// When short (channel) is ignored, the element (like/dislike AND short itself) is
// hidden with a 0 DOMRect. In this case, consider it outside of Viewport
!(rect.top == 0 && rect.left == 0 && rect.bottom == 0 && rect.right == 0) &&
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= height &&