Fix bug that sometimes causes text to be unselectable