Open Bug 1614288 Opened 5 years ago Updated 3 years ago

onpaste event and pasting of pdf file is working inconsistently when compared to chrome.

Categories

(Core :: DOM: Events, enhancement, P3)

72 Branch
enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: sph.prakash, Unassigned)

Details

(Keywords: parity-chrome)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:72.0) Gecko/20100101 Firefox/72.0

Steps to reproduce:

i implemeted a onPaste event handler and used the following code.


  validatePasteItems = (clipBoardData, uploadCallback) => {
    const { setAlert } = this.props
    const { value } = this.state
    const { items: pastedItems = [] } = clipBoardData
    const totalItemsPasted = pastedItems.length
    for (let i = 0; i < totalItemsPasted; i++) {
      const pasteItem = pastedItems[i]
      const { type: pastedFileType = "" } = pasteItem
      if (pastedFileType && pastedFileType.indexOf("image") !== -1) {
        let pastedFileBlob = pasteItem.getAsFile()// returns null if i paste a pdf file. in chrome it is working.
        if (pastedFileBlob) {
          //this is not executed.
       }
}
}
}


Now copy a pdf file to clipboard, and paste into a text/textarea field.



Actual results:

the issue is, it is working in chrome , it is not working in firefox.


Expected results:

It should work consistently in browsers.
Summary: onpaste pdf → onpaste event and pasting of pdf file is working inconsistently when compared to chrome.
Component: Untriaged → DOM: Events
Keywords: parity-chrome
Product: Firefox → Core
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.