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

Input elements default prevented when inside the dragZone #22

Open
daveraanan opened this issue May 19, 2015 · 3 comments
Open

Input elements default prevented when inside the dragZone #22

daveraanan opened this issue May 19, 2015 · 3 comments

Comments

@daveraanan
Copy link

Hi guys,

you lib is great, easy and convenient. when i set a dragZone on a container you are preventing default on all elements, can you PREVENT the prevent default on elements like button and input's.
ex: i have a numeric input but the input is not been updated!
it will be nice to have a way to set a dragZone with CSS classes to be ignored on mouse down event, it will easily add support for css buttons (div's buttons).

Thanks

@sunesimonsen
Copy link
Collaborator

Hi, I think I know what you mean, but could you possible provide a working example that highlights the problem. If you just fork the project and add another example I'll figure out if it is possible to support your use case. knockout-dragdrop does a lot of bad stuff to work nicely across browsers, so your use case might conflict with the main functionality. But there will probably be some way around the issue.

@daveraanan
Copy link
Author

Hi, here is a demo on jsfiddle https://jsfiddle.net/rnwzagnk/2/, but this issue with the input is NOT happening, meaning it is working fine. I checked my code and it is exactly the same.
for my code to work i need to add a workaround in your script on line 456, i check the the mouse event only if the target element is not 'input' i prevent default:
if (downEvent.target && downEvent.target.localName !== 'input') {
downEvent.preventDefault();
}
do you think of more tests i can do to understand why the jsfiddle demo is working and me code do not?....on jsfiddle i encountred a different issue, when you drag a row item out of the table it creates another item. on me code it do not with or without the workaround
Thanks

@sunesimonsen
Copy link
Collaborator

Hey thanks for the fiddle, that is really helpful. I'll look into the problem soon. Now I have a clear understanding of what it is you are trying to achieve.

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