Event listener when cq-FileUpload-clear is clicked

472 Views Asked by At

I have javascript function that listens to any change in value made to coral-FileUpload element on the cq dialog.

$('coral-FileUpload').on('change', (event) => {
            // my code
});

The above code works fine when any asset is dropped from DAM. However, it does not detect any change when the 'clear' button is clicked.

2

There are 2 best solutions below

0
On

You can write this:

$(".cq-FileUpload-clear").on('click', (event) => {
       //your code 
});
0
On