I'm working on a D8 project and in many cases I use file and image upload fields.
The files and the images are visible above the field and the user can delete them by using the default 'Remove' button.
What I want to do, is to add a confirmation popup asking if they really want to delete that files/images.
Is there any hook that I could use to make that check? If I use javascript, how can I say to drupal that now can proceed to deletion?
Thank you in advance.
EDIT:
I tried to do what @Ivan suggested but I can't make it work. My form has submit and ajax callback. Should I alter both?
Is there any working example? I am so desperate!!