Due to the placement of the "else" on line 168 of UIControlBase.cs, the button doesn't lose focus until the raycast hits nothing.