If someone does something during the daytime in Ramadan thinking that it invalidates the fast while it actually does not, is he considered to have broken his fast based on the fact that he intended that? He had this wrong belief that it invalidates the fast and that it is forbidden in Ramadan, and he did it in spite of that and even said that if it invalidates the fast, he will do it, but it was not something from the invalidators of fasting. Is his fast deemed invalid?
All perfect praise be to Allah, the Lord of the worlds. I testify that none is worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
If one does something that he believes invalidates the fast but it was not as such in fact, like swimming for example, and he actually did it while thinking that it beaks his fast, then he is considered to not be fasting because what he did eliminates and contradicts the intention of fasting. This is a matter that invalidates the fast according to those who adopt the opinion that rejecting the intention of fasting invalidates it. This is what we adopt out of caution for the religion. The questioner should fast a day in order to make up for that day. This is only because the intention is a pillar of fasting, as in the Hadeeth: “The reward and validity of deeds are only determined according to intentions.” [Al-Bukhari] This confirmation indicates the invalidity of deeds if intentions are invalid.
Allah knows best.
You can search for fatwa through many choices