-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Keyboard drag dimension clipping fix #137
Conversation
// Get the true visible bounds of the droppables. | ||
// We calculate it once here and pass it on in an | ||
// object along with the original droppable. | ||
.map((droppable: DroppableDimension): Candidate => ({ |
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.
basically we just use the droppable's visible bounds everywhere now instead of the droppable's dimension. we calculate it once here and pass it along with the droppable.
{ x: fragment.right, y: fragment.bottom }, | ||
]; | ||
}; | ||
const getCorners = (bounds: Spacing): Position[] => [ |
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.
awesome! maybe this should go into spacing.js
@@ -31,70 +28,81 @@ type GetBestDroppableArgs = {| | |||
droppables: DroppableDimensionMap, | |||
|} | |||
|
|||
type Candidate = { |
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.
whoa - can you explain this a little?
…ulating best droppable
…ions. add comment.
3975e02
to
3713f89
Compare
@alexreardon I've re-pointed this at master and actioned your previous comments. lmk if you have a chance to review this, otherwise I'll get someone in AK to take a look. Basically the difference is that we're now using the clipped bounds rather than the full droppable dimension in |
I won’t have a chance. Thanks for the heads up
…On Thu, 12 Oct 2017 at 1:19 pm, Jared Crowe ***@***.***> wrote:
@alexreardon <https://github.com/alexreardon> I've re-pointed this at
master and actioned your previous comments. lmk if you have a chance to
review this, otherwise I'll get someone in AK to take a look.
Basically the difference is that we're now using the clipped bounds rather
than the full droppable dimension in get-best-cross-axis-droppable.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#137 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACFN7SRWAWZOVAf2sK8VYG9OpVQ4YH_hks5srXc4gaJpZM4PzT7s>
.
|
return a.page.withMargin[axis.start] - b.page.withMargin[axis.start]; | ||
})[0]; | ||
return a[axis.start] - b[axis.start]; | ||
})[0].droppable; |
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.
is there a chance that candidates
could be an empty array?
edit: sorry just saw the candidates.length
check above, it was hidden in the PR folded lines
fixes #136