SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.97k stars 1.24k forks source link

Upload Set(sap.m.upload.UploadSet) drag and drop not working #3622

Closed wajidbaba closed 1 year ago

wajidbaba commented 2 years ago

OpenUI5 version: any latest version, eg: (1.105.1) Browser/version (+device/version): chrome Any other tested browsers/devices(OK/FAIL):

URL (minimal example if possible): https://sapui5.hana.ondemand.com/resources/sap/ui/documentation/sdk/index.html?sap-ui-xx-sample-id=sap.m.sample.UploadSetGroupingSortingFiltering&sap-ui-xx-sample-lib=sap.m&sap-ui-xx-sample-origin=.&sap-ui-xx-dk-origin=https%3A%2F%2Fsapui5.hana.ondemand.com&sap-ui-theme=sap_horizon&sap-ui-rtl=false&sap-ui-density=sapUiSizeCompact

User/password (if required and possible - do not post any confidential information here):

Steps to reproduce the problem:

  1. open https://sapui5.hana.ondemand.com/resources/sap/ui/documentation/sdk/index.html?sap-ui-xx-sample-id=sap.m.sample.UploadSetGroupingSortingFiltering&sap-ui-xx-sample-lib=sap.m&sap-ui-xx-sample-origin=.&sap-ui-xx-dk-origin=https%3A%2F%2Fsapui5.hana.ondemand.com&sap-ui-theme=sap_horizon&sap-ui-rtl=false&sap-ui-density=sapUiSizeCompact
  2. Try to drag and drop a file, file opens in a new tab and get's downloaded and control remains in the highlighted state forever
  3. We Assume issue is only when grouping is enabled

What is the expected result? File needs to be dropped What happens instead? open up in new tab and get's downloaded Any other information? (attach screenshot if possible)

kineticjs commented 2 years ago

Hi @wajidbaba,

The outcome you are describing occurs when you drop files that are not listed [as allowed] into both the "fileTypes" and "mediaTypes" field, see the sample source: https://sapui5.hana.ondemand.com/#/entity/sap.m.upload.UploadSet/sample/sap.m.sample.UploadSetGroupingSortingFiltering/code/Page.view.xml for its currently configured allowed types.

I see e.g. that .png and .jpg files are not allowed by the above sample configuration (so maybe the sample should be enhanced to include "image/png" into the "mediaType" field, since it already includes "png" into its "fileType" field).

Apart from that, when I drag and drop a .txt file, it does get accepted at the sample.

If you are testing with different file types and the drop fails, you can also see the console output for more info, see e.g. the line where the uploader complaints about not allowed file type: https://github.com/SAP/openui5/blob/master/src/sap.ui.unified/src/sap/ui/unified/FileUploader.js#L1567

Regards, Diana

kineticjs commented 2 years ago

Hello @wajidbaba ,

I've created an internal incident 2270161508 to enhance the sample to allow drop image files.. The status of the issue will be updated here in GitHub. Please reply here if you see additional issues on your side.

Regards, Diana

wajidbaba commented 2 years ago

Hello @kineticjs Here issue is not with the sample,but the control itself it seems, Even if we drop a .txt file it's opening in new tab and getting downloaded (Note: try to run the sample in new tab by selectng this and try to drop ) image.

If we have (system popup from where we select a file ) on top of our control(in focus) then only weare getting the issue. but if system popup is not in focus it's working properly.

https://user-images.githubusercontent.com/10095836/197773953-644013f4-4891-411d-92be-38f1fed94dba.mp4

I562693 commented 2 years ago

Hello All,

Samples have been updated accordingly and will be available from SAPUI5 version 1.109.

Regards, Vinay

I562693 commented 2 years ago

Hi @wajidbaba,

Regarding the drag and drop area the file when dropped into focused area would be picked for upload as it would be the drop area otherwise they are opened in new tab.

Regards, Vinay

wajidbaba commented 2 years ago

Hi @I562693,

Can you please check the attached video in my last post, we are dropping into focused area only, still it's getting opened in new tab. check (https://sapui5.hana.ondemand.com/#/entity/sap.m.upload.UploadSet/sample/sap.m.sample.UploadSetGroupingSortingFiltering) this sample.

Regards, Wajid

wajidbaba commented 2 years ago

Hi @I562693,

any update on this?

Vir45 commented 1 year ago

Hi all, The problem is that the uploadSet does not correctly consider the darg-a-drop area. If I drop file near the text "Drop files here", all works fine. But, if I drop file in another place in darg-a-drop area, the browser thinks, that it is not darg-a-drop area. Also, this issue is reproduced on Windows machines, on macOs - all works fine. Please, watch the attached video.

Thanks, Vova

https://user-images.githubusercontent.com/49695153/208851478-4d7ee136-4d60-4b00-b889-e95dab95b30c.mov

I562693 commented 1 year ago

Hi,

We have forwarded the issue to Drag and Drop team and are looking into it. We will update the details.

Regards, Vinay

wajidbaba commented 1 year ago

Hi @I562693,

we are still facing this issue, any update on this?

ghost commented 1 year ago

Hello All,

The issue is fixed and will be there in the latest version of SAPUI5 (version 1.113) and can be tested in the sample as well.

Thanks Bhumika