@@ -182,25 +182,33 @@ test( "#9315: jumps down with offset of scrollbar", function() {
182
182
} ) ;
183
183
} ) ;
184
184
185
- test ( "#5009: scroll not working with parent's position fixed" , function ( ) {
185
+ test ( "scroll offset with fixed ancestors " , function ( ) {
186
186
expect ( 2 ) ;
187
187
188
188
var startValue = 300 ,
189
- element = $ ( "#draggable1" ) . wrap ( "<div id='wrapper' />" ) . draggable ( {
190
- drag : function ( ) {
191
- startValue += 100 ;
192
- $ ( document ) . scrollTop ( startValue ) . scrollLeft ( startValue ) ;
193
- } ,
194
- stop : function ( event , ui ) {
195
- equal ( ui . position . left , 10 , "left position is correct when parent position is fixed" ) ;
196
- equal ( ui . position . top , 10 , "top position is correct when parent position is fixed" ) ;
197
- $ ( document ) . scrollTop ( 0 ) . scrollLeft ( 0 ) ;
198
- }
199
- } ) ;
189
+ element = $ ( "#draggable1" )
190
+ // http://bugs.jqueryui.com/ticket/5009
191
+ // scroll not working with parent's position fixed
192
+ . wrap ( "<div id='wrapper' />" )
193
+ // http://bugs.jqueryui.com/ticket/9612
194
+ // abspos elements inside of fixed elements moving away from the mouse when scrolling
195
+ . wrap ( "<div id='wrapper2' />" )
196
+ . draggable ( {
197
+ drag : function ( ) {
198
+ startValue += 100 ;
199
+ $ ( document ) . scrollTop ( startValue ) . scrollLeft ( startValue ) ;
200
+ } ,
201
+ stop : function ( event , ui ) {
202
+ equal ( ui . position . left , 10 , "left position is correct when parent position is fixed" ) ;
203
+ equal ( ui . position . top , 10 , "top position is correct when parent position is fixed" ) ;
204
+ $ ( document ) . scrollTop ( 0 ) . scrollLeft ( 0 ) ;
205
+ }
206
+ } ) ;
200
207
201
208
TestHelpers . forceScrollableWindow ( ) ;
202
209
203
210
$ ( "#wrapper" ) . css ( "position" , "fixed" ) ;
211
+ $ ( "#wrapper2" ) . css ( "position" , "absolute" ) ;
204
212
205
213
element . simulate ( "drag" , {
206
214
dx : 10 ,
0 commit comments