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

[drag and drop] prevent default dnd behavior #6188

Merged
merged 1 commit into from
Sep 19, 2019
Merged

Conversation

vince-fugnitto
Copy link
Member

@vince-fugnitto vince-fugnitto commented Sep 13, 2019

What it does

Fixes #674

  • prevent default dnd (drag & drop) behavior when dragging a file from
    the filesystem into Theia. The default browser behavior meant that
    the application was replaced by the browser attempting to open the file
    as a URL.
  • [minor] fix a few typos in the same file.

Tested

  • tested in Chrome, Firefox and Safari

How to test

  1. open a workspace
  2. when no files are currently opened, attempt to drag a file from your filesystem into the application's main panel
  3. the application should not be replaced with the browser attempting to open the file as a URL (in master this is the case
  4. make sure that other dnd events (ex: explorer) still work correctly
Example

Additional Notes

In the future, we can attempt to open the file in an editor if possible, but looking at the current web API, obtaining the path of a file and opening it does not seem possible. Perhaps we can come up with a workaround as to download the file, store it temporarily, and then open it.

Review checklist

Reminder for reviewers

Signed-off-by: Vincent Fugnitto vincent.fugnitto@ericsson.com

Fixes #674

- prevent default dnd (drag & drop) behavior when dragging a file from
the filesystem into Theia. The default browser behavior meant that
the application was replaced by the browser attempting to open the file
as a URL.
- [minor] fix a few typos in the same file.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
@vince-fugnitto vince-fugnitto added the bug bugs found in the application label Sep 13, 2019
@vince-fugnitto vince-fugnitto self-assigned this Sep 13, 2019
@vince-fugnitto vince-fugnitto added the dnd issues related to drag & drop label Sep 13, 2019
@akosyakov
Copy link
Member

Please as part of verification check that it does not break d&d of file in the navigator, and parts in the debug view.

@vince-fugnitto
Copy link
Member Author

Please as part of verification check that it does not break d&d of file in the navigator, and parts in the debug view.

I've verified the following cases in the explorer:

  • dnd a file from my filesystem into a folder in the explorer
  • dnd a file from one folder to another in the explorer
  • also tested the same two scenarios in a multi-root workspace

How can I verify dnd in the debug view?

@akosyakov
Copy link
Member

How can I verify dnd in the debug view?

Move parts, e.g. Variables after Breakpoints.

@vince-fugnitto
Copy link
Member Author

How can I verify dnd in the debug view?

Move parts, e.g. Variables after Breakpoints.

Thanks, I confirmed it still works correctly.

Copy link
Contributor

@lmcbout lmcbout left a comment

Choose a reason for hiding this comment

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

LGTM
Tested on Ubuntu 16.04 with Chrome and Firefox

  • D&D over the editor does not open the file and the browser remains in Theia
  • D&D in explorer works well
  • Cancel button in the progress dialog stops the transfer for large folder
    Tested on single and multi-root
    Code looks good

@vince-fugnitto vince-fugnitto merged commit 137afd5 into master Sep 19, 2019
@vince-fugnitto vince-fugnitto deleted the vf/GH-674 branch September 19, 2019 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application dnd issues related to drag & drop
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ui] Drag & Drop a file inside THEIA editor should not replace THEIA web page
3 participants