Using oj-file-picker
<oj-file-picker selection-mode=“single”
on-oj-select=‘[[selectListener]]’
on-oj-invalid-select=‘[[invalidListener]]’
accept=‘[“image/*“]’ invalidListener : function(event) {
showErrorPopup(‘Please Select Valid image’);
}Issue : In invalidListener added method to launch popup with message.
If we drag and drop invalid file, popup launches which blocks drop event and selected file opens in browser.
Tried cancelling event by calling,
stopPropagation, preventDefault , stopImmediatePropagation
on event, event.detail.originalEvent, event.detail.originalEvent.nativeEventDidnt help. any alternative so that dragged file wont open in browser tab ?