Commit 123da431 authored by Constance Okoghenun's avatar Constance Okoghenun

CE Port of fix for roadmap forward timeline scroll

EE MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9530
parent c470a779
......@@ -130,7 +130,7 @@ export const isInViewport = (el, offset = {}) => {
rect.top >= (top || 0) &&
rect.left >= (left || 0) &&
rect.bottom <= window.innerHeight &&
rect.right <= window.innerWidth
parseInt(rect.right, 10) <= window.innerWidth
);
};
......
......@@ -855,6 +855,7 @@ describe('common_utils', () => {
});
it('returns true when provided `el` is in viewport', () => {
el.setAttribute('style', `position: absolute; right: ${window.innerWidth + 0.2};`);
document.body.appendChild(el);
expect(commonUtils.isInViewport(el)).toBe(true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment