-
Notifications
You must be signed in to change notification settings - Fork 51
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
Conversation
tajo
commented
Jul 2, 2019
•
edited
Loading
edited
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!