Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chat] Add drag and drop handlers to web/desktop #714

Merged
merged 8 commits into from
Dec 10, 2020

Conversation

marcaaron
Copy link
Contributor

@marcaaron marcaaron commented Oct 26, 2020

cc @thienlnam @roryabraham for extra eyes since y'all reviewed a similar one to this

Fixed Issues

Fixes https://github.com/Expensify/Expensify/issues/141090

Tests

  1. Drag various files from the finder into the text input
  2. Verify the text input is highlighted when a file is over it
  3. Verify that you can drag and drop images, PDFs, zip files, and a preview opens
  4. Verify you can upload the file type if supported

Screenshots

Screen Shot 2020-12-09 at 3 25 35 PM
Screen Shot 2020-12-09 at 3 25 37 PM
Screen Shot 2020-12-09 at 3 25 39 PM

@marcaaron marcaaron self-assigned this Oct 26, 2020
@marcaaron marcaaron changed the title [HOLD] Add drag and drop handlers to web/desktop Add drag and drop handlers to web/desktop Dec 10, 2020
@marcaaron marcaaron marked this pull request as ready for review December 10, 2020 01:29
@marcaaron marcaaron requested a review from a team as a code owner December 10, 2020 01:29
@botify botify requested review from tylerkaraszewski and removed request for a team December 10, 2020 01:30
@marcaaron marcaaron changed the title Add drag and drop handlers to web/desktop [Chat] Add drag and drop handlers to web/desktop Dec 10, 2020
@tylerkaraszewski
Copy link
Contributor

This isn't working for me at all in Firefox.

It seems to work in Chrome but is kind of ugly:
Screen Shot 2020-12-10 at 12 06 21 PM

@marcaaron
Copy link
Contributor Author

Thanks for testing @tylerkaraszewski, will check out Firefox and see what's up there!

Can you try refreshing if the styles are looking weird? There's another issue that causes some missing CSS styles that we are still sorting out. If you notice in the image you shared the modal is not the only thing that is messed up looking. Status indicator next to avatar and paperclip in text input are also off center.

@tylerkaraszewski
Copy link
Contributor

Yes, refreshing fixed the styling issue. I'll wait for your feedback on Firefox.

@marcaaron
Copy link
Contributor Author

marcaaron commented Dec 10, 2020

Figured it out. The dragover event must have preventDefault() called on it otherwise Firefox won't allow file drag and drop 🤷 more info here -> https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API

Should be working now.

@tylerkaraszewski
Copy link
Contributor

Looks good in Chrome and FF now.

@tylerkaraszewski tylerkaraszewski merged commit 529f132 into master Dec 10, 2020
@tylerkaraszewski tylerkaraszewski deleted the marcaaron-dragAndDrop branch December 10, 2020 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants