#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:3 Changed 12 years ago by
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.
comment:4 Changed 12 years ago by
Owner: | set to rdworth |
---|---|
Status: | new → 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/
comment:5 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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
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
Milestone: | 1.9 → 1.8.14 |
---|
Test page: http://jsfiddle.net/jnTfS/2/
Patch suggested: https://github.com/jquery/jquery-ui/pull/94