Draggable: Add "updatePosition" option to control if we want to automatically update the position of the draggable. #718

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

Draggable: Add "updatePosition" option to control if we want to automatically update the position of the draggable.
This is useful for some advanced usage of draggable where you want to update the position yourself in the drag callback.

Update ui/jquery.ui.draggable.js
Draggable: Add "updatePosition" option to control if we want to automatically update the position of the draggable.
This is useful for some advanced usage of draggable where you want to update the position yourself in the drag callback.
Owner

scottgonzalez commented Aug 23, 2012

How does this relate to refreshPositions?

As I understand it, it doesn't.

Here's an example of this option in use:
http://arp242.net/tmp/jqueryui/updatePosition.html

Without this option, the draggable updates the position of the .bar, which means it goes up twice as fast as the .bottom div grows in height since I do the updating in the drag callback.

This is just one usage scenario, there are probably others.

Owner

scottgonzalez commented Sep 26, 2012

So to clarify, you want to use draggable, but never have it actually drag? That doesn't seem like an option we should add. Have you tried just calling event.preventDefault() in the drag callback?

Member

mikesherov commented Nov 5, 2012

Hi @Carpetsmoker, thanks again for contributing this patch. We recently re-enabled the test suite for draggable. In order for us to land this patch, we'd need a few tests added to the test suite proving this doesn't break existing functionality and also that it fixes the bug as described. Can you add some tests here please?

Member

mikesherov commented Nov 9, 2012

Hi @Carpetsmoker, thanks again for contributing this pull request! However, we're not going to be adding this option to core. This fiddle shows preventDefault is adequate to cover your use case: http://jsfiddle.net/ZKxMR/1/

In the future, please submit a bug on the bug tracker http://bugs.jqueryui.com first so we can discuss the issue before doing the work to fix it. There are tons of bugs to fix there too if you'd like to contribute further.

@mikesherov mikesherov closed this Nov 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment