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

"__dockview_internal_drag_event__" is pasted if drop on an editable widget #584

Open
hackwaly opened this issue Apr 25, 2024 · 1 comment

Comments

@hackwaly
Copy link

Drag a tab to chrome's location bar, it will replace the location to "dockview_internal_drag_event"

@techbech
Copy link
Contributor

techbech commented May 9, 2024

I wanted to make it possible to drag a tab onto another application, so I requested the possibility to access the data transfer object

#299

It was implemented here

https://github.com/mathuo/dockview/pull/322/files#diff-a22c4f0fca5755287b9458a40efb6520028ddad7a4224ab7f83ae524900551afR86-R114

        const panelDragDisposable = api.onWillDragPanel((event) => {
            const dataTransfer = event.nativeEvent.dataTransfer;

            if (dataTransfer) {
                dataTransfer.setData(
                    'text/plain',
                    'Some custom panel data transfer data'
                );
                dataTransfer.setData(
                    'text/json',
                    '{text: "Some custom panel data transfer data"}'
                );
            }
        });

This way, you can make the value, when dropped in a text field, whatever you like.

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

No branches or pull requests

2 participants