Anas bin Malik reported,

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."

Azami 2611

Sahih

عن أنس بن مالك قال

قال النبي ﷺ: ما بال أقوام يرفعون أبصارهم إلى السماء في صلاتهم؟ فاشتد قوله في ذلك حتى قال: لينتهن عن ذلك، أو لتخطفن أبصارهم.

الأعظمي 2611صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
What is prohibited and disliked in prayer
Section
Dislike of raising one's gaze to the sky during prayer
Numbering
Jami al-Kamil 2611 (2nd edition)
Azami 2611