I'm working on an image field on Adobe AEM and in the editor script, I need to enable another field only when an image is selected. I'm using the change
event to trigger my function that enables the other fields and it works if you type something in the field but I need to do the same when the author drags and drops an image into the field.
My field:
<modeldefaultimageturntable
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
fieldDescription="Select the turntable default image that is shown when an error occurs"
fieldLabel="Select the turntable default image"
name="./turntableDefaultImage"
rootPath="/content/dam"
droppable="{Boolean}true"/>
And this is how I'm applying the change
event:
$(document).on(
"change",
"foundation-autocomplete[name='./turntableDefaultImage']",
function (e) {
setTurntableDefaultImageAltValidation(e.target);
}
);
I've been googling for quite a while and still didn't find the event triggered when an author drops an image in this field. Some examples of events I've tried: assetselected
, cq-asset-dropped
, coral-dragaction:drop
. I've actually tried many others which I don't remember at the moment.
Does anyone know the right event or an alternative method to do it?
Thanks