question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Drag breaks with absolute positioning

See original GitHub issue

I’m experiencing weird dragging, when parent element have absolute positioning. Here is an example http://codepen.io/anon/pen/zxpvVa All I did is added to container

position: absolute;

Here is essentially the same issue, but this draggable uses jquery ui. https://github.com/angular-ui/ui-sortable/issues/97 Issue is repeating in ng-sortable also, but not in rubaxa/Sortable. (Both are non jquery)

Do you have any ideas how it could be solved?

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
rickhopkinscommented, Sep 1, 2016

I changed the styles for the modal-dialog to this and it solved my issue. Basically I read @timbell’s post and thought I’d just try taking off the transform and transition. Seems to work although it prevents the modal window from sliding in from the top. Oh well…

div.modal-dialog {
    -webkit-transform: none !important;
    -ms-transform: none !important;
    -o-transform: none !important;
    transform: none !important;

    -webkit-transition: none !important;
    -o-transition: none !important;
    transition: none !important;
}
0reactions
iqidancommented, Sep 20, 2017

position: absolute;不占据文档空间,var containmentRect = closestElement.call($element, opts.containment)[0].getBoundingClientRect();获取高度有问题,现在改为客户端内容高度,拖动不会超过客户端的内容高度范围 ==》 var containments = closestElement.call($element, opts.containment); var containmentRect = containments[0].getBoundingClientRect(); containmentRect = { top:containmentRect.top, left:containmentRect.left, width:containmentRect.width, height:containments[0].clientHeight }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make a draggable element whitout setting position to ...
I tried to change the CSS position property from absolute to relative, It make elements set next to each other but I can't...
Read more >
Advanced layouts with absolute and fixed positioning
The answer is that absolutely positioned elements, like floated elements, automatically generate block boxes. The positions you specify will apply relative to ...
Read more >
position - CSS: Cascading Style Sheets - MDN Web Docs
An absolutely positioned element is an element whose computed position value is absolute or fixed . The top , right , bottom ,...
Read more >
CSS absolute and fixed positioning - W3C Wiki
Absolutely positioned elements are removed entirely from the document flow. That means they have no effect at all on their parent element or...
Read more >
What is Absolute Positioning in Web Design?
Absolute Positioning is a web design technique that involves “breaking the grid” using absolute Positioning for elements.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found