We used to greet the Messenger of Allah ﷺ with the salam while he was praying, and he would return our greeting. But when we returned from our visit to the Najashi, we greeted him and he did not return our greeting.We said, "Messenger of Allah, we used to greet you during prayer and you would return our greeting."He replied, "Prayer demands one's full attention."
حدثنا أبو بكر بن أبي شيبة وزهير بن حرب وابن نمير وأبو سعيد الأشج وألفاظهم متقاربة قالوا حدثنا ابن فضيل حدثنا الأعمش عن إبراهيم عن علقمة
كنا نسلم على رسول الله ﷺ وهو في الصلاة فيرد علينا فلما رجعنا من عند النجاشي سلمنا عليه فلم يرد علينا فقلنا يا رسول الله كنا نسلم عليك في الصلاة فترد علينا فقال إن في الصلاة شغلا