Dear student ,
Temperature of any substance remains constant because the heat supplied to increase the temperature is utilised in changing the state of matter.
Since the heat is used to overcome the force of attraction, the temperature of the substance does not change. The heat energy absorbed in this case is called as the latent heat.
Regards !!!