Fixes issues #8503 and #8505

#8503: "Cursor is not focused correctly."
#8505: "No scrollbar appears when you exceed control height."