Narrated Abdullah ibn Abbas: AbusSahba' said: We discussed the things that cut off the prayer according to Ibn Abbas. He said: I and a boy from Banu Abdul Muttalib came riding a donkey, and the Messenger of Allah ﷺ was leading the people in prayer. He dismounted and I also dismounted. I left the donkey in front of the row (of the worshippers). He (the Prophet) did not pay attention to that. Then two girls from Banu Abdul Muttalib came and joined the row in the middle, but he paid no attention to that.
Hadith Referenceسنن ابي داود / تفرح أبواب ما يقطع الصلاة وما لا تقطعها / 716
Hadith Gradingالألبانی:صحيح | زبیر علی زئی:إسناده حسن, أخرجه النسائي (755 وسنده حسن) والحاكم بن عتيبة صرح بالسماع عند ابن خزيمة (835)
Hadith Takhrij« سنن النسائی/القبلة 7 (755)، (تحفة الأشراف: 5687)، وقد أخرجہ: مسند احمد (1/235) (صحیح) »
´It was narrated that Suhaib said:` "I heard Ibn Abbas narrate that he passed in front of the Messenger of Allah (ﷺ), he and a young boy of Banu Hashim, riding a donkey in front of the Messenger of Allah(ﷺ) when he was praying. Then they dismounted and joined the prayer, and he did not stop praying. Then two young girls of Banu Abdul-Muttalib started running around and grabbing him by the knees. He separated them but he did not stop praying."
Hafiz Muhammad Ameen
755. Commentary: Ibn Abbas (radi Allahu anhuma) is reasoning here that a donkey and a woman do not invalidate the prayer, whereas in other ahadith it is explicitly stated that the prayer is invalidated by them. Therefore, it can be said that here the mention is of a sutrah (barrier), not of passing in front of young girls. The main point is that the Prophet (sallallahu alayhi wa sallam) used to pray facing a sutrah. Even if it is accepted that they (the girls) passed between him (sallallahu alayhi wa sallam) and the sutrah, those girls were not of age (i.e., not adults), so their passing did not invalidate the prayer, because the prayer is invalidated by the passing of a menstruating or adult woman. And Allah knows best.
Source: Sunan Nasa'i: Translation and Benefits by Shaykh Hafiz Muhammad Amin Hafizullah, Page: 755