Answered by Shaykh Faraz Rabbani
Recently I found myself in a situation where I had to pray a congregational prayer whilst holding a baby. Now, I know that excessive movement invalidates the salat, but during the prayer I had to keep gently rocking the child to prevent him from getting agitated by being held still in the same position. Also, I had to move him from one side to the other (i.e. one arm to the other) as my arm got tired, from the weight. Further, on a couple of occasions his dummy fell out, and I had to use my other arm to replace it. Finally, since I was holding him, that (left) arm could not be used to fulfil things like the placing of that arm in ruku, sujud, etc. So, would all this have invalidated my salat? And secondly, what exactly *is* the fiqh of praying whilst holding a baby?
Excessive action invalidates the prayer.
Fidgeting (`abath, which is repeated unnecessary slight actions) is prohibitively disliked.
Unnecessary slight action is somewhat disliked (makruh tanzihan).
Slight action done with a reasonable excuse is excused, though one should be careful to keep it to the minimal extent possible.
Excessive action is defined, according to the soundest position, as being action that would lead an onlooker from a distance, with no prior knowledge that the person is praying, be certain that the person is NOT praying. When in doubt, it is not excessive action and does not invalidate the prayer. Usually, three uninterrupted major movements would be considered excessive. [Based from Ibn Abidin’s Radd al-Muhtar]
As such, slight movements are allowed. However, one should arrange things in a way that avoids having to think too much about the baby during prayer, as it detracts from the essence of the prayer, which is presence of heart with Allah.
One thing to be careful about is that if the child is not toilet-trained (such that they can now normally control their bowel movements), then carrying them if they have najasa on them (i.e. in their diapers) would invalidate the prayer.
And Allah knows best.