Skip to content

Conversation

@10xjs
Copy link
Contributor

@10xjs 10xjs commented Mar 20, 2018

edgeOffset is used to represent a margin at the the bounds rect edge. Previously it was only a prop used within the FlowTip react component that was subtracted from the resolved bounds rect, effectively shrinking it. This had the undesirable effect of also applying the margin to between the positioned tooltip and viewport edge when the target was outside the viewport.

What we really want the tail side of the tooltip to have its own margin, separate from the body. When the tooltip is positioned at the screen edge, the larger of the two margins will determine the final position.

Before:

At the boundary edge, offset and targetOffset are be added together.
image

After:

At the boundary edge, only largest of offset and targetOffset is used.
image

@10xjs 10xjs force-pushed the calculate-edge-offset branch from 3c11cfc to 9d92fb0 Compare March 20, 2018 23:22
`edgeOffset` is used to represent a margin at the the bounds rect edge. Previously it was only a prop used within the `FlowTip` react component that was subtracted from the resolved `bounds` rect, effectively shrinking it. This had the undesirable effect of also applying the margin to between the positioned tooltip and viewport edge when the target was outside the viewport.

What we really want the tail side of the tooltip to have its own margin, separate from the body. When the tooltip is positioned at the screen edge, the larger of the two margins will determine the final position.
@10xjs 10xjs force-pushed the calculate-edge-offset branch from 9d92fb0 to 9c9eb02 Compare March 20, 2018 23:36
@10xjs 10xjs merged commit a1c0bfc into master Mar 20, 2018
@10xjs 10xjs deleted the calculate-edge-offset branch March 20, 2018 23:42
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.

2 participants