Drag breaks with absolute positioning
See original GitHub issueI’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:
- Created 9 years ago
- Comments:7
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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…
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 }