Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#6859 closed bug (fixed)

Jquery.Simulate drag behaves incorrect when container scrolled

Reported by: danilsomsikov Owned by: rdworth
Priority: minor Milestone: 1.8.14
Component: [meta] ui.test Version: 1.8.8
Keywords: Cc:
Blocked by: Blocking:

Description

Coordinates for mouse events are based on element offset(), which are relative to page, but events are generated in client coordinates, which are relative to window. In the case of non-zero scroll coordinates will be wrong.

Change History (7)

comment:1 Changed 12 years ago by danilsomsikov

Last edited 12 years ago by danilsomsikov (previous) (diff)

comment:2 Changed 12 years ago by Scott González

#6863 is a duplicate of this ticket.

comment:3 Changed 12 years ago by tomykaira

This seems to be because the sample trys to move the block by clicking the center, which is not shown to the user. So, for example, with "y = Math.floor(center.y)-30" on line 115 of jquery.simulate.js, the bug does not occur.

This is not a bug of jQuery.Simulate (maybe a part of this problem is a bug), but a mismatch between the intention of a developer and the actual movement of the simulator.

I think the simulator should try the 4 edges whether they are visible or not, and if all of them are not clickable by an user, it should say that the testcase is wrong.

Last edited 12 years ago by tomykaira (previous) (diff)

comment:4 Changed 12 years ago by rdworth

Owner: set to rdworth
Status: newassigned

I created a test page that more clearly demonstrates the problem in simulate's findCenter function, as well as a fix: http://jsfiddle.net/rdworth/QAMED/1/

Last edited 12 years ago by rdworth (previous) (diff)

comment:5 Changed 12 years ago by Richard D. Worth

Resolution: fixed
Status: assignedclosed

Simulate: account for document scroll in findCenter function. Fixes #6859 - Jquery.Simulate drag behaves incorrect when container scrolled

Changeset: de3fc0050ee672ce155f0dd65ee9ecdfd818c063

comment:6 Changed 12 years ago by Richard D. Worth

Simulate: account for document scroll in findCenter function. Fixes #6859 - Jquery.Simulate drag behaves incorrect when container scrolled (cherry picked from commit de3fc0050ee672ce155f0dd65ee9ecdfd818c063)

Changeset: bb076e313f6b5ca68435bdc0dd179f4173368c85

comment:7 Changed 12 years ago by rdworth

Milestone: 1.91.8.14
Note: See TracTickets for help on using tickets.