unclecheese / react-selectable

A component for react that allows mouse selection of child items
MIT License
142 stars 72 forks source link

react-selectable not working correctly inside absolutely positioned element #9

Closed leopoldjoy closed 8 years ago

leopoldjoy commented 8 years ago

Hello,

When I place my <SelectableGroup> inside of another element that is position: absolute, the drag box is offset by a few hundred pixels and doesn't work. To show the problem, I used the demo and only changed .main to have the attribute position: absolute. Here's an example of the problem: https://jsfiddle.net/tcLyb278/

Why is the dragging offset so much? What can we do to fix this?

Thanks!

unclecheese commented 8 years ago

Use the fixedPosition prop. https://github.com/unclecheese/react-selectable/blob/master/src/selectable-group.js#L225

Needs to be documented.

leopoldjoy commented 8 years ago

Thanks unclecheese! I added documentation for fixedPosition and submitted a pull request.