So I have a row of buttons in a ScrollArea with a ScrollBar beneath it like that:

Everything works fine when I press the left mouse button, move the scroll bar, release the button and move my mouse over one of the buttons.
But when I press the left mouse button on the scrollbar and then move my mouse over a button and release it, the button won’t get hovered until I either release and press the button again or hover a different ui object.
I guess this is because Unity keeps the ScrollBar focused when I move my mouse out of the ScrollBars area to keep it moveabe but fails to reset the focus in this case somehow. Any idea on how to fix that?
Found a workaround!
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System;
using System.Collections.Generic;
public class ScrollbarWithFix : Scrollbar, IEndDragHandler
{
public void OnEndDrag(PointerEventData eventData)
{
GraphicRaycaster graphicsRaycaster = this.GetComponentInParent<GraphicRaycaster>();
PointerEventData pointerEventData = new PointerEventData(null);
pointerEventData.position = Input.mousePosition;
List<RaycastResult> results = new List<RaycastResult>();
graphicsRaycaster.Raycast(pointerEventData, results);
foreach(RaycastResult result in results)
{
Selectable sel = result.gameObject.GetComponent<Selectable>();
if(sel != null)
{
sel.OnPointerEnter(new PointerEventData(EventSystem.current));
}
}
}
}