The Messenger of Allah ﷺ said, "What is the matter with people who raise their eyes toward the sky during their prayer?" His words on this grew severe, until he said, "They must stop doing this, or their sight will be snatched away."
أخبرنا عبيد الله بن سعيد وشعيب بن يوسف عن يحيى وهو ابن سعيد القطان عن ابن أبي عروبة عن قتادة
أن رسول الله ﷺ قال ما بال أقوام يرفعون أبصارهم إلى السماء في صلاتهم فاشتد قوله في ذلك حتى قال لينتهن عن ذلك أو لتخطفن أبصارهم
Bukhari narrated it in the Book of Adhan, the chapter on raising the eyes to the sky during prayer, hadith no. 750, from the hadith of Yahya Qattan with this same chain, and it is also found in Al-Kubra, hadith no. 542.