Is it possible to call a custom ajax event after removing a file from a managed_file field? I have a custom form with a managed_file field element. I'd like to call an ajax event after removing a file (clicking the REMOVE button).
Is there a way to expand the existing ajax callback for the remove button?
What I'm trying to do is fire a custom ajax event after clicking the REMOVE button on a managed_file element to remove an element from the dom.
I tried to do the same in D7 a while ago and I discovered a JS only solution is not possible. You need to add an ajax command to the Drupal callback.
Here's a similar question to yours. This one is about the upload button and you want the remove button.
In D7, the upload and remove button were handled by the same function and when I look at the D8 class of the managed file I also see only one callback: uploadAjaxCallback. So it might be worth checking that out.