Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removable items by moving them out of bounds #16

Merged
merged 3 commits into from
Jul 2, 2019
Merged

Removable items by moving them out of bounds #16

merged 3 commits into from
Jul 2, 2019

Conversation

tajo
Copy link
Owner

@tajo tajo commented Jul 2, 2019

removable

@tajo tajo changed the title WIP: Removable by move Removable by move Jul 2, 2019
@tajo tajo changed the title Removable by move Removable items by moving them out of bounds Jul 2, 2019
Copy link

@chasestarr chasestarr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool! lgtm

}
return true;
}
if (this.state.itemDraggedOutOfBounds > -1) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a bit unsure why state is reset here. calling isDraggedItemOutOfBounds a second time is required to get back to default? My first instinct would be to reset after this value is consumed. Interested to learn why this was positioned here

Copy link
Owner Author

@tajo tajo Jul 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isDraggedItemOutOfBounds is constantly called when an item is being moved around and then one more time when dropped. In both cases, this.state.isDraggedItemOutOfBounds can be reseted so that's why I put it directly into this method so it can be done only in one place.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When an item is being moved around, it can be be flipped to > -1 and back multiple times.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@tajo tajo merged commit ea61c27 into master Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants