Fix UI glitch in edit mode