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

Allow text to be dropped into sortable INPUT fields #254

Closed
thardyman opened this issue Feb 2, 2015 · 5 comments
Closed

Allow text to be dropped into sortable INPUT fields #254

thardyman opened this issue Feb 2, 2015 · 5 comments
Labels
enhancement Quality of life changes to existing features
Milestone

Comments

@thardyman
Copy link

Enhancement request: I have some INPUT fields and the default browser behaviour allows a user to drop text from another browser window directly into the input field. When I put these into a sortable list then this default functionality is prevented. I hope this makes sense.

The issue is that preventDefault() called on the dragover event. This happens even if I set dragoverBubble to true. I have managed to fix this by changing line 467: -

            if (evt.preventDefault !== void 0 && !options.dragoverBubble) {
                evt.preventDefault();
                evt.stopPropagation();
            }

Would you like me to create a pull request for this?

Congratulations. It's a fantastic project, really well written and useful. Thanks.

@RubaXa
Copy link
Collaborator

RubaXa commented Feb 2, 2015

Create an example on jsbin.com

@thardyman
Copy link
Author

Here is an example of the issue using the latest sortable code: -

http://jsbin.com/gebedemanu/2/edit

Here is an example of it working using the modified code proposed above: -

http://jsbin.com/juvapomizu/2/edit

You'll notice that you can drag and drop text from another browser window into the fields on the working example, but not on the one with the latest sortable code.
(I had to host my library at dropbox because JSBin refused to run the code from github as the mime type wasn't right.) The code on dropbox is the same as in the pull request - issue-254.

Cheers, Tim

Tim

@RubaXa
Copy link
Collaborator

RubaXa commented Feb 7, 2015

Try drop-text-branch

@RubaXa RubaXa added the enhancement Quality of life changes to existing features label Feb 7, 2015
@thardyman
Copy link
Author

Hi,

Yes that works fine for me. Thanks!

Tim

On 7 February 2015 at 20:06, Lebedev Konstantin [email protected]
wrote:

Try drop-text https://github.com/RubaXa/Sortable/tree/drop-text/-branch


Reply to this email directly or view it on GitHub
#254 (comment).

@RubaXa RubaXa added this to the v1.1.0 milestone Feb 11, 2015
@RubaXa RubaXa closed this as completed Feb 11, 2015
@thardyman
Copy link
Author

This issue seems to have regressed. I can't seem to drop text into fields using Sortable 1.1.1. Can we re-open this issue or should I create a new one?

Cheers,
Tim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Quality of life changes to existing features
Projects
None yet
Development

No branches or pull requests

2 participants