Talha bin Ubaydullah reported,

We used to pray while animals passed in front of us. We mentioned this to the Messenger of Allah ﷺ, and he said, "Something the size of the back of a saddle placed in front of one of you is enough, and then whatever passes in front of him will not harm him."Ibn Numayr's version says, "Then whoever passes in front of him will not harm him."

Muslim 1112

Sahih

و حدثنا محمد بن عبد الله بن نمير وإسحق بن إبراهيم قال إسحق أخبرنا وقال ابن نمير حدثنا عمر بن عبيد الطنافسي عن سماك بن حرب

عن موسى بن طلحة عن أبيه قال

كنا نصلي والدواب تمر بين أيدينا فذكرنا ذلك لرسول الله ﷺ فقال مثل مؤخرة الرحل تكون بين يدي أحدكم ثم لا يضره ما مر بين يديه و قال ابن نمير فلا يضره من مر بين يديه

مسلم 1112صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Prayer
Chapter
Screen of the one praying
Numbering
Darussalam 1112
Muslim 1112