The answer: The scholars differed on this issue. (1) Some held that the prayer is invalidated, giving two reasons:
The first reason is that it is an act prohibited within an act of worship; and when a person performs an act prohibited within an act of worship, he invalidates it—such as speaking during the prayer, and eating or drinking while fasting—because it is incompatible with it.
The second reason is that it involves turning away from the qiblah, since when he raises his head, his body faces the qiblah but his face does not.
However, what appears correct to me is that the matter does not reach the point of invalidating the prayer.
As for the argument that it is a turning away from the qiblah, this is countered by looking to the right or left: one who does so has turned away from the qiblah, yet his prayer is not invalidated.
As for the argument that it is an act prohibited within an act of worship and therefore invalidates it—just as prayer is invalidated by speech and fasting by eating and drinking, so this is similar—there is no doubt that this is a strong argument. Nevertheless, one does not feel fully assured in instructing a worshipper to repeat his prayer merely because he raised his head toward the heaven. Rather, we say: Your prayer is in danger. As for sin, you are sinful. Accordingly, if a student of knowledge sees people raising their eyes during the prayer, he must teach them that this is unlawful. I see many people, especially when they raise their heads from bowing, raise their faces toward the heaven! So let them beware of that.
And closing one’s eyes, ..............
His statement, “and closing one’s eyes,” means that closing one’s eyes is disliked; that is: