The Prophet ﷺ said, "What is the matter with people who raise their eyes toward the sky during their prayer?" His words on this grew stern, until he said, "They must stop doing this, or their sight will be snatched away."
قال النبي ﷺ: ما بال أقوام يرفعون أبصارهم إلى السماء في صلاتهم؟ فاشتد قوله في ذلك حتى قال: لينتهن عن ذلك، أو لتخطفن أبصارهم.
Bukhari narrated it in the chapter on adhan (750), from Ali bin Abdullah, who said, Yahya bin Saeed informed us, who said, Ibn Abu Aruba narrated to us, who said, Qatada narrated to us, that Anas bin Malik narrated to them, and he related the same account.Ibn Majah also narrated it (1044) through the hadith of Abdul-Ala bin Abdul-Ala, from Saeed (Ibn Abu Aruba), adding at the beginning, "The Messenger of Allah ﷺ led his companions in prayer one day, and when he had finished the prayer, he turned his face toward the people," and then he related the same account.