Sunan Abi Dawud Book 2, Hadith 325
I came riding a donkey. Another version has: Ibn Abbas said: When I was near the age of the puberty I came riding a she-ass and found the Messenger of Allah (ﷺ) leading the people in prayer at Mina. I passed in front of a part of the row (of worshippers), and dismounting left my she-ass for grazing in the pasture, and I joined the row, and no one objected to that.
Abu Dawud said: These are the words of al-Qa'nabi, and are complete. Malik said: I take it as permissible at the time when the iqamah for prayer is pronounced.
I used to sleep lying between the Messenger of Allah (ﷺ) and the qiblah. The Messenger of Allah (ﷺ) used to pray when I (was lying) in front of him. When he wanted to offer the witr prayer - added by the narrator Uthman - he pinched me - then the narrators are agreed - and said: Set aside.
AbusSahba' said: We discussed the things that cut off the prayer according to Ibn Abbas. He said: I and a boy from Banu AbdulMuttalib 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 AbdulMuttalib came and joined the row in the middle, but he paid no attention to that.