It is allowed to do necessary minor actions while praying but not the major actions. Our Sunni fellows make excuses that how come Imam Ali let the person take away his ring while he was praying. They said it invalids the prayer but it is hard for them to say anything about mother Aisha's movement while praying.
Please read the narration " I came to `Aisha while she was praying, and said to her, "What has happened to the people?" She pointed out towards the sky.
URDU TRANSLATION:
ENGLISH: