Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Fixed file attachments component in IE11 #1179

Merged
merged 3 commits into from
Oct 6, 2017

Conversation

Blackbaud-SteveBrush
Copy link
Member

@Blackbaud-SteveBrush Blackbaud-SteveBrush commented Oct 6, 2017

Addresses: #1131

(This branch also includes some code-style adjustments; tabs, etc. I'll denote the core changes via comments.)

The primary issue is that IE11 does not support DataTransfer.items. I researched other libraries, and how they handle this, and they allow any file on the dragover event, but do the file-type checking on drop. This pull request deals with this problem in the same way.

https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/items#Browser_compatibility
https://caniuse.com/#feat=dragndrop

this.acceptedOver = true;
}

} else if (transfer.files) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition gets called when the data transfer is not empty, but does not support items.

if (dropEvent.dataTransfer && dropEvent.dataTransfer.files) {
if (this.verifyDropFiles(dropEvent.dataTransfer.items)) {
if (this.verifyDropFiles(dropEvent.dataTransfer.files)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the final core change.

@codecov-io
Copy link

codecov-io commented Oct 6, 2017

Codecov Report

Merging #1179 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1179   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files         355     355           
  Lines        6590    6592    +2     
  Branches      842     844    +2     
======================================
+ Hits         6590    6592    +2
Impacted Files Coverage Δ
src/modules/fileattachments/file-drop.component.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da7c22d...ac2616b. Read the comment docs.

@Blackbaud-SteveBrush Blackbaud-SteveBrush merged commit a982def into master Oct 6, 2017
@Blackbaud-SteveBrush Blackbaud-SteveBrush deleted the fix-ie11-filedrop branch October 6, 2017 20:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants