Answer
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
If your headscarf slipped off during prayer and your hair is partially uncovered accidentally, you need not worry and your prayer is valid.
In responding to your question, Sheikh Ahmad Kutty, a senior lecturer and an Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
Covering the awrah or parts that should remain covered absolutely in prayer is a condition for the Prayer’s validity. So, if anyone deliberately omitted the same, the Prayer is rendered invalid; one ought to repeat it.
If the awrah is uncovered accidentally, then the preferred view of some eminent scholars is it is fine as long it is something marginal and not majorly. So, if your headscarf slipped and your hair is partially uncovered accidentally, you need not worry; your Prayer is valid.
Having said, I would like to add. Since prayer is the best of our deeds in Allah’s sight, we ought to focus on doing it as best as we can. Doing prayer right means praying correctly by fulfilling all of the conditions and etiquette while keeping the spirit alive.
Allah in the Quran orders us to establish prayer. Establishing the prayer is not merely performing it any way we choose. Instead, it entails observing both the form and spirit as taught by the Prophet (peace be upon him) who said, “Pray as you have seen me praying.” (Al-Bukhari)
Let us, therefore, be attentive in our prayer and pray to Allah to accept them.
Almighty Allah knows best.