Part of the process when we create tooltips is that we need to calculate the size of the tooltip. This diff introduces the function that will handle calculating the size of the tooltip.
Details
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
web/utils/tooltip-utils.js | ||
---|---|---|
422–425 ↗ | (On Diff #34744) | For me, it doesn't sound right to include a margin within a size. A margin tells how far a thing is shifted and doesn't make it any bigger. Can we somehow avoid including it? Why do we include it in the calculation? |
web/utils/tooltip-utils.js | ||
---|---|---|
422–425 ↗ | (On Diff #34744) | The purpose of this function is to calculate the size of the navigation tooltip component so that we can use this to determine where is the best place to render the tooltip. Based on how the tooltip component is built, the blue highlighted area is considered the tooltip component (which includes the margin): If we don't consider the margin in this calculation the width of the tooltip component will be 24px short and could lead to the tooltip being rendered to the right and overflowing by 24px instead of being rendered to the left or another direction of its origin point (not likely in this case since this tooltip is on the far left of the screen, but hopefully this example explains my point) I definitely should factor out the margin size, but let me know if you guys have any more questions about the margin! |