-
Notifications
You must be signed in to change notification settings - Fork 427
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
Fix jquery.event.drag suppressing native drag and drop #239
Comments
Thanks for filling this issue, I am also interested in this since it is causing a similar issue with a user that also included Froala Editor library. I tried your 1st patch but only commenting out the 2 lines 157-158 with Option 2 is probably better but might require more changes and touching a few files. If you're willing to create a PR, I would vote for option 2 |
This has been attempted, but got very quickly complicated. Check out on the new Slickgrid website - there's a section discussing this. It would be great to get rid of the dependencies, if it is indeed possible without major headaches. |
@6pac Option 1 wasn't working in my case though (with this other lib that requires touch/mouse), I tried modifying a few other lines in the |
The site is basic, but hopefully it will take care of the most important issues so we can just link to it rather than having to chase down the appropriate issues. Any suggestions or enhancements welcome! I'll get around to putting it on the wiki or its own github account soon. Would it be possible for you to put together a PR for a really simple example with the touch lib in the |
@6pac
|
@6pac
Here's my reply: Here's the features shown on their GitHub
|
Hey guys, was looking for the solution for this issue and made a workaround that works with froala and slickgrid (on my current project), if it suits to someone: |
@loonix |
When it initiates it does not detect if you have just selected text (if I am not wrong) so I have added a conditional that checks if the user is dragging, if it is not dragging it is selecting, so I set the I haven't tested with other plugins, for me at the moment is working: Happy to do a PR if everyone agrees |
@6pac @ghiscoding made the PR. |
Fix to Fix jquery.event.drag suppressing native drag and drop #239
@yamass @loonix
With this in mind, I came up with 2 lines of code to change in the change from // check for suppressed selector
if ( $( event.target ).is( dd.not ) ) to this new change // check for suppressed selector
// make sure the target css class starts with "slick-" so that we know it's in a Slick Grid and not outside of it
var targetClass = $( event.target ).attr('class') || "";
if ( $( event.target ).is( dd.not ) || (!targetClass || targetClass.toString().indexOf('slick-') === -1))
return; I'll make a PR soon, though I would be happy to get some feedback EDIT |
fix(drag): make sure drag event are only for slickgrid, fixes #239
I am using slickgrid in combination with fullcalendar and some custom component using native drag and drop.
Problem:
Native drag and drop does not work in our whole application, since jquery.event.drag cancels them globally!
Details / Cause analysis:
$event.add( this, "touchstart mousedown", drag.init, data );
(v2.3.0, line 82)mousedown
events is registered to a DOM node (something like$myDiv.on("mousedown", handleDragStart)
), the jquery.event.drag code gets executed.event.preventDefault()
by returning false:if ( !drag.touched || dd.live ) return false;
(v2.3.0, line 158; will return false, since mousedown is not a touch event)mousedown
event handler via jQuery ondocument
... No native drag and drop on the whole page.I see two possible solutions:
return false
statement.(Developers should care for text selection themselves via CSS:
user-select: none;
)I can provide a pull request for this, if you want.
I can provide a pull request for the column resizing implementation, which would make the dependency to jquery.event.drag optional for many developers.
The text was updated successfully, but these errors were encountered: