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

React-dnd feature is broken within vscode when files are drag and dropped #96770

Closed
Uma19 opened this issue May 1, 2020 · 6 comments
Closed
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) webview Webview issues

Comments

@Uma19
Copy link

Uma19 commented May 1, 2020

Version of vscode
from 1.40 to 1.44.2 versions. The below issue is reproducible

Issue description:
Its not allowing me to drop the file and giving me overlay effect, while dragging the files within vscode and dropping within the editor section, that contains my code related with "React-dnd" library.

Steps to repro

Taken sample code from vscode => webView Sample
I have modified the code to pick "react-dnd" code within "iframe".

<iframe height="500vh" width="100%" sandbox="allow-scripts" nonce="${nonce}" src="${iframesrc}"></iframe>

And now on top of that when I try to drag any file within vscode , it doesnt allow me to drop and gives me some overlay effect

Also attaching the Screenshot of the same
react-dnd-failes

expected result should be like below. Allowing files to drop
expected-result

let me know if any other information is needed regarding the same

@vscodebot
Copy link

vscodebot bot commented May 1, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@Uma19
Copy link
Author

Uma19 commented May 1, 2020

@egamma : Hi Erich
I had raised one more issue regarding the same on which you had asked me to provide some more input . Sorry I couldnt able to reply to your comment at that time and the issue got auto closed.
So again had created one more issue with some more details
Also find the existing issue reported
#85030

@Uma19
Copy link
Author

Uma19 commented May 1, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

Hi Team,
This is not the same issue
As mine is mainly associated with application that is using react-dnd library and is getting loaded within vscode

@sbatten
Copy link
Member

sbatten commented May 1, 2020

@mjbvz I don't think this is related to my changes as I've never touched the editor's drag and drop handler.

@sbatten sbatten removed their assignment May 1, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented May 2, 2020

This has never been supported as far as I know. I'm closing this as a duplicate of #8794

@mjbvz mjbvz closed this as completed May 2, 2020
@mjbvz mjbvz added *duplicate Issue identified as a duplicate of another issue(s) webview Webview issues labels May 2, 2020
@Uma19
Copy link
Author

Uma19 commented May 2, 2020

Hi @mjbvz
This feature was supported till 1.39.2 version of vscode and then later onwards this stopped working

In 1.44.2 version
Please find the below suspected codes that is responsible for the issue that I am raising. and the same code doesn't exist in 1.39.2 where my functionality was working

From the below code => it seems to be it creates an overlay within editor part
https://github.com/microsoft/vscode/blob/1.44.2/src/vs/workbench/browser/parts/editor/editorPart.ts
//#region TODO@matt this should move into some kind of service

createEditorDropTarget(container: HTMLElement, delegate: EditorDropTargetDelegate): IDisposable {
	return this.instantiationService.createInstance(EditorDropTarget, this, container, delegate);
}

//#endregion

https://github.com/microsoft/vscode/blob/1.44.2/src/vs/workbench/contrib/webview/browser/baseWebviewElement.ts

windowDidDragStart(): void {
// Webview break drag and droping around the main window (no events are generated when you are over them)
// Work around this by disabling pointer events during the drag.
// electron/electron#18226
if (this.element) {
this.element.style.pointerEvents = 'none';
}
}

windowDidDragEnd(): void {
	if (this.element) {
		this.element.style.pointerEvents = '';
	}
}

https://github.com/microsoft/vscode/blob/1.44.2/src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts

windowDidDragStart() {
this.withWebview(webview => webview.windowDidDragStart());
}

windowDidDragEnd() {
	this.withWebview(webview => webview.windowDidDragEnd());
}

And in 1.39.2 version you will NOT find the similar kind of codes exist in the respective file

https://github.com/microsoft/vscode/blob/1.39.2/src/vs/workbench/browser/parts/editor/editorPart.ts
https://github.com/microsoft/vscode/blob/1.39.2/src/vs/workbench/contrib/webview/browser/dynamicWebviewEditorOverlay.ts

And the one that I have raised is different than the one that you have mentioned as duplicated issue
#8794

As in this , the user is trying to drag the button within the webview itself , whereas in my case I am trying to drag the items that is part of VSCODE menu items to the EDITOR panel

@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) webview Webview issues
Projects
None yet
Development

No branches or pull requests

3 participants