Added event confusion with presets and new add
manchumahara opened this issue · comments
It seems if some presetss images/files are loaded the added event triggers same way if the new files are added after the page load.
How can we differentiate between the two condition. On added event I need to send ajax request to upload the image, but what I find is presets are also triggering the same event.
Hmm yes I see what you're saying. I'm not sure if this is something I'd consider adding right away - as there is an easy way to check whether the event is from the preset images. To accomplish this I would just check the result of the event with what you know to be the preset images.
If they match - then you know they are the preset images. If not, you know you're in a non-preset event.
Thank you for your answer. Can you please write sample code how you check the event if from preset or from new?
when present the logic is
e.detail.files[0].name === 'preset-file'