Narrated Aishah, Ummul Muminin: The Messenger of Allah ﷺ was praying with his door bolted. I came and asked to have the door opened. He walked and opened the door for me. He then returned to his place for prayer. He (the narrator Urwah) mentioned that the door faced the qiblah.
Hadith Referenceسنن ابي داود / أبواب تفريع استفتاح الصلاة / 922
1؎ : From these hadiths, it is clearly understood that walking out of necessity, opening a door, picking up a staff to kill a snake or scorpion, or lifting a child into one's lap and then setting him down—none of these actions invalidate the prayer.
Explanation & Benefits
Shaykh Umar Farooq Saeedi
922. Commentary: This narration is weak in its chain of transmission. However, if the door is facing the qiblah and is only a few steps away, and there is no one else in the house to respond, then there appears to be no harm in taking a few steps to open the door. Firstly, this action is minor. Secondly, the person praying does not turn away from the qiblah. Thirdly, this will not significantly affect his humility in prayer (khushu' fi as-salah). «والله اعلم»
Source: Sunan Abu Dawood – Commentary by Shaykh Umar Farooq Saeedi, Page: 922
´Urwah narrated that Aishah said:` "I came while the Messenger of Allah was praying in the house and the door was closed. So he walked until he opened the door for me, then he returned to his place." And she described the door to be in the direction of the Qiblah.
Shaykh Dr. Abdur Rahman Freywai
1: It is permissible in Sunnah and Nafl (supererogatory) prayers to walk in such a manner that one does not turn away from the Qiblah.
Source: Sunan al-Tirmidhi – Majlis ‘Ilmi Dar al-Da‘wah, New Delhi Edition, Page: 601