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:
1- If the authorities impose cremation of all corpses during Coronavirus (COVID-19) pandemic including Muslims, funeral prayer should be offered while the bodies are present prior to cremation. Alternatively, it could be offered in the presence of their ashes.
2- If none of these solutions is proved viable, then the funeral prayer should be offered in the absence of the deceased.
In responding to this question, the European Council for Fatwa and Research (ECFR), states:
In the beginning, it must be stressed that Islam honors humans and puts them in a high position. Allah says: “We have honored the children of Adam.” (Al-Israa 17:70)
Islam prescribes burying the deceased. The Quran relates the legislation of burial when narrating the story of the children of Adam at the very early stage of mankind: “Then Allah sent a raven, who scratched the ground, to show him how to hide the shame of his brother.” (Al-Maidah 5:31)
Islamic texts urge people to handle the corpses in a kind way by prescribing washing, shrouding, praying and burying. All these procedures are to be conducted in a gentle way.
The Prophet Muhammad (peace be upon him) says: “Breaking a bone of a deceased person is like breaking a bone of a living one.” (Abu Dawud and Ahmad)
We are aware that the European countries are considerate of the religious distinctiveness of the deceased. Since burial constitutes part of the distinctiveness of the deceased Muslims, Muslims are to demand that the concerned bodies in every country should facilitate Muslims with Muslim cemeteries or Muslim sections in public cemeteries to bury Muslim deceased especially when currently it is impossible to transfer Muslim corpses to the countries they come from and the only available option is to bury them in the countries where they died in consistency with their religious teachings.
If it so happens and the authorities impose cremation of all corpses including Muslims contradicting the way affairs are to be managed, funeral prayer should be offered while the bodies are present prior to cremation. Alternatively, it could be offered in the presence of their ashes.
If none of these solutions is proved viable, then the funeral prayer should be offered in the absence of the deceased. Funeral prayer is a prayer of mercy and forgiveness and every Muslim deceased is in need of it.
In order to avoid non-Islamic handling, the ECFR urges every Muslim to make a written legal will and testimony stating that upon death the corpse is to be handled in consistency with Islamic teaching.
Almighty Allah knows best.
Source: https://www.e-cfr.org/