Salah is invalidated by speaking deliberately, eating or drinking, excessive unnecessary movement, leaving the qibla, or losing wudu. If a required pillar of the prayer is omitted, the prayer is not valid until corrected.
Evidence — the daleel
Sahih Muslim 539a ṢaḥīḥSahih al-Bukhari 135 Ṣaḥīḥ
On deen2u
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.