function getScroll() {
	const tabRight = tabLeft + tabWidth;
	const scrollX = $parent.scrollLeft;

	/**@type {number} scroll value */
	let scroll = 0;

	// tab right should be greater than parent right
	const rightDiff = tabRight - parentRight;
	// tab left should be less than parent left
	const leftDiff = parentLeft - tabLeft;

	const scrollSpeed = (diff) => {
		const ratio = diff / tabWidth;
		return ratio * MAX_SCROLL_SPEED;
	};

	if (leftDiff > 0 && scrollX > MIN_SCROLL) {
		scroll = -scrollSpeed(leftDiff);
	} else if (rightDiff > 0 && scrollX < MAX_SCROLL) {
		scroll = scrollSpeed(rightDiff);
	}

	return scroll;
}
Checks if the tab is going to scroll and returns the scroll value