The Messenger of Allah (ﷺ) said: The people who lift their eyes towards the sky in Prayer should avoid it or they would lose their eyesight.
Sahih Muslim Book 4, Hadith 128