unclecheese / react-selectable

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

Add support for finishing the selection outside the selectable area #33

Closed dbertella closed 7 years ago

dbertella commented 7 years ago

When you selecting items and you finish out of the selectable area you enter in a stuck state. Adding listeners to the document will help on this

Example react-selectable

The PR include also a change that set the container to be in position relative, and will calculate the rect are from the beginning of this area instead of from the beginning of the page.

Before if you include the SelectableGroup in a container with position relative or absolute with top or left different than 0 it won't work as expected anymore.

unclecheese commented 7 years ago

Thanks for this! Would be keen to merge the positioning fixes as a separate commit. The mouse events have been resolved by a separate PR https://github.com/unclecheese/react-selectable/pull/38

prescottprue commented 7 years ago

Any update on when this will be merged?

unclecheese commented 7 years ago

Did you see my previous comment? The mouse fixes have come in as a separate PR. Wondering if you can break out just the commit for the positioning fixes? Also needs a rebase. Keen to merge if you can provide that. Thanks!

unclecheese commented 7 years ago

Sorry, I just realised I was addressing you as if you were the author of the PR. My apologies.

prescottprue commented 7 years ago

@unclecheese Thanks!

Just to confirm: these fixes do in fact fix the mouse placement issue for me.

Going to just run this fork for now, but will try making a PR soon if it is isn't already taken care of.

dbertella commented 7 years ago

Hi guys unfortunately I looked into this and I don't remember very much what I've done few months ago. If you can take it and make a new pr go for it. Otherwise I will try to look again into it in the next few days.

On Sep 7, 2017 00:38, "Scott" notifications@github.com wrote:

@unclecheese https://github.com/unclecheese Thanks!

Just to confirm: these fixes do in fact fix the mouse placement issue for me.

Going to just run this fork for now, but will try making a PR soon if it is isn't already taken care of.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/unclecheese/react-selectable/pull/33#issuecomment-327641200, or mute the thread https://github.com/notifications/unsubscribe-auth/ACccfFUFNM0mNKp-4zMYVQioylrUKwXNks5sfy0JgaJpZM4LYR1y .

prescottprue commented 7 years ago

Here is the PR I made with just the positioning stuff like you asked @unclecheese. Since it is basically a duplicate of this, you can close this issue.