Ticket #6859 (closed bug: fixed)

Opened 4 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 4 years ago by danilsomsikov

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

comment:2 Changed 4 years ago by scott.gonzalez

#6863 is a duplicate of this ticket.

comment:3 Changed 3 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 3 years ago by tomykaira (previous) (diff)

comment:4 Changed 3 years ago by rdworth

  • Owner set to rdworth
  • Status changed from new to assigned

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 3 years ago by rdworth (previous) (diff)

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

  • Status changed from assigned to closed
  • Resolution set to fixed

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

Changeset: de3fc0050ee672ce155f0dd65ee9ecdfd818c063

comment:6 Changed 3 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 3 years ago by rdworth

  • Milestone changed from 1.9 to 1.8.14
Note: See TracTickets for help on using tickets.