The Messenger of Allah ﷺ said, "People must stop raising their eyes to the sky during prayer, or their sight will not return to them."
قال رسول الله ﷺ: لينتهين أقوام يرفعون أبصارهم إلى السماء في الصلاة أو لا ترجع إليهم.
Muslim reported it in the Book of Prayer (428) through the narration of Amash, from Musayab, from Tamim bin Tarafa, from Jabir bin Samura, and he mentioned something similar.