Search and Top Navigation
#6859 closed bug (fixed)
Opened January 14, 2011 04:54PM UTC
Closed May 26, 2011 08:58AM UTC
Last modified May 26, 2011 09:09AM UTC
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.
Attachments (0)
Change History (7)
Changed January 14, 2011 04:58PM UTC by comment:1
_comment0: | Test page:http://jsfiddle.net/jnTfS/2/ \ Patch suggested: https://github.com/jquery/jquery-ui/pull/94 \ → 1295024340941226 |
---|---|
_comment1: | Test page: http://jsfiddle.net/jnTfS/2/[[BR]] \ \ Patch suggested: https://github.com/jquery/jquery-ui/pull/94 \ → 1295024355695518 |
Changed May 16, 2011 01:20AM UTC by comment:3
_comment0: | 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. \ \ 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. → 1305518707430829 |
---|
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.
Changed May 26, 2011 08:55AM UTC by comment:4
_comment0: | 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/ → 1306400745886770 |
---|---|
owner: | → 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/
Changed May 26, 2011 08:58AM UTC by comment:5
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
Changed May 26, 2011 09:09AM UTC by comment:6
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
Changed May 26, 2011 09:09AM UTC by comment:7
milestone: | 1.9 → 1.8.14 |
---|
Test page: http://jsfiddle.net/jnTfS/2/
Patch suggested: https://github.com/jquery/jquery-ui/pull/94