Search and Top Navigation
#4433 closed bug (duplicate)
Opened April 03, 2009 08:48PM UTC
Closed April 16, 2009 02:11AM UTC
Last modified October 11, 2012 09:15PM UTC
Selectables lasso can be positioned wrongly, depending on body element style
Reported by: | willdean | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | ui.selectable | Version: | 1.7.1 |
Keywords: | selectable lasso | Cc: | |
Blocked by: | Blocking: |
Description
The symptoms of the problem are that the Selectables selection lasso appears offset to the right of the cursor position as you drag.
It occurs because of the following:
1. The selection helper is a child of 'body' (that's the default) 2. The selection helper is absolute positioned within body.
3. The top,left position of the selection helper is set using clientX,clientY, which are window-relative.
If the page layout is such that a. body is positioned (relative or absolute), and b. body's (0,0) coordinates are not the same as the client's (0,0) (e.g. there's a left margin)
Styling body like this:
body { position: relative; width: 960px; margin-left: auto; margin-right: auto; }
will show this problem - the selection lasso will be offset from the cursor position by the size of body's left margin.
To fix this, the cursor coordinates need to be mapped from clientX,clientY to body's (or whatever element the selection helper has been attached to) coordinate space before setting the position of the helper.
Duplicate of #4377.