Search the Community
Showing results for tags 'placeholderdiv'.
-
Hello, currently I am trying to update a project from gsap 1.18.2 to 1.20.2. The project uses Draggable with type: 'scrollTop' for some scrollable views. With the new version of Draggable the `_placeholderDiv` div element gets added to those views on drag. This results in some undesired behaviour - width of lists are now wrong, because the parentNodes width is added to the placeholder div. Looking through the gsap versions, a change was introduced in version 1.19.0 Before: if (self.autoScroll && !rotationMode && !scrollProxy && target.parentNode && !target.getBBox && target.parentNode._gsMaxScrollX && !_placeholderDiv.parentNode) {//add a placeholder div to prevent the parent container from collapsing when the user drags the element left. _placeholderDiv.style.width = (target.parentNode.scrollWidth) + "px"; target.parentNode.appendChild(_placeholderDiv); } After: if (target.parentNode && (scrollProxy || (self.autoScroll && !rotationMode && target.parentNode._gsMaxScrollX && !_placeholderDiv.parentNode)) && !target.getBBox) { //add a placeholder div to prevent the parent container from collapsing when the user drags the element left. _placeholderDiv.style.width = (target.parentNode.scrollWidth) + "px"; target.parentNode.appendChild(_placeholderDiv); } In 1.18.2 the conditional tested for !scrollProxy. Current versions test for scrollProxy. Is this change on purpose? And if, how do I disable the insertion of the placeholder div (besides disabling it in the Draggable source code)? Cheers! Christian
- 5 replies
-
- placeholderdiv
- draggable
-
(and 1 more)
Tagged with: