Skip to content

positioning error when swapping elements. #83

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

Closed
donaldinho opened this issue Mar 10, 2014 · 1 comment
Closed

positioning error when swapping elements. #83

donaldinho opened this issue Mar 10, 2014 · 1 comment
Labels

Comments

@donaldinho
Copy link

I have a page that I am developing which uses something similar to the dnd-ctrl-as-syntax.html demo.

There is a list with draggable and droppable elements linked to the same model. In my page there is an ancestor element that has position:relative and this is affecting the positioning of the swap animation.
angular-dragdrop uses .offset() to find the position of the elements. This is obviously relative to the document but in my case the elements are then positioned relative to the parent element that has position:relative making them appear in the wrong place.

Locally I've changed angular-dragdrop to use .position() but I'm not sure how this should be treated in the more general case.

@codef0rmer
Copy link
Owner

I should probably have a containment option in jqyoui-draggable to fix this issue. By default its document and parent otherwise.

  • For document, it will use .offset()
  • For parent, its .position()

codef0rmer pushed a commit that referenced this issue Apr 7, 2014
  - Fix for callbacks that do not fire
  - Update README to help contributors to run server/scripts
  - Closes #85 and #83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants