Forum Stats

  • 3,874,178 Users
  • 2,266,677 Discussions
  • 7,911,757 Comments

Discussions

oj-file-picker , invalid FIle opens in browser tab

Abhijit-Oracle
Abhijit-Oracle Member Posts: 20 Employee
edited Oct 25, 2022 11:23PM in Oracle JET

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 ?

Answers