Opened 14 years ago

Closed 14 years ago

Last modified 10 years ago

#4433 closed bug (duplicate)

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:


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.
  2. 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.

Change History (2)

comment:1 Changed 14 years ago by Scott González

Resolution: duplicate
Status: newclosed

Duplicate of #4377.

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

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.