Cursor sticks for a small distance on UI elements not on canvas

And you can also check if this helps with any minimal lag: