Answer
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
We may bathe, take a shower, swim and dip in water while fasting if we take care not to swallow water or allow water to get into our system.
Responding to your question, Sheikh Ahmad Kutty, a senior lecturer and an Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
We may bathe, take a shower, swim and dip in water while fasting if we take care not to swallow water or allow water to get into our system.
We read in an authentic report from Aishah, the beloved wife of the Prophet (peace be upon him), that the Prophet would sometimes wake up in a state of janabah (during Ramadan), and he would bathe and continue his fast.
Imam Al-Bukhari cited a report from Anas ibn Malik, one of the Companions of the Prophet (peace be upon him), in which he said, “I have a water cistern, filled with water, in which I immerse myself while fasting to cool myself off.”
Almighty Allah knows best.