Observations of enhanced fast-ion losses during edge localized modes (ELMs) have been reported in the ASDEX Upgrade tokamak, revealing losses above the injection energy. This suggests that fast ions can be accelerated and lost by the ELMs. Recent analysis delves into the analysis of the ELM-induced losses, suggesting that the fast ions are lost due to a resonant interaction with the electromagnetic perturbation during the ELM crash. The fast-ion transport and acceleration mechanism during ELMs is modelled using electromagnetic fields from the hybrid kinetic-MHD code MEGA and full orbit simulations with the orbit-following code ASCOT. Time-evolving 3D electromagnetic fields have been implemented in ASCOT to compute fast-ion orbits in the presence of fast MHD events such as ELMs. The simulations successfully reproduce a field-aligned pattern of the losses on the tokamak wall and a formation of an accelerated population on the confined and lost fast-ion distribution. A parametric study of the fast-ion constants of motion suggests a resonant interaction between the fast-ions and the electromagnetic fields arising during the ELM crash. In the case of fast-ion acceleration, the perpendicular electric perturbation, with scales smaller than the fast-ion gyroradius, breaks the magnetic moment invariability and resonantly modifies the fast-ion energy.