Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've updated the LTR positioning logic to:
First check if there's enough space on the right side
If yes, position on right and set hasEnoughSpace = true
If not enough space on right, check if there's enough space on left
If yes, position on left and set hasEnoughSpace = true
If not enough space on either side
Force position on right side without setting hasEnoughSpace
This means the tooltip will be allowed to extend beyond the viewport
The RTL logic remains unchanged, preferring the left side but falling back to right if needed.
The viewport boundary check (Math.max(10, Math.min(left, viewportWidth - tooltipWidth - 10))) will only be applied when
hasEnoughSpace is true, which means:
For LTR: Only when there's enough space on the preferred side (right or left)
For RTL: Only when there's enough space on the left side
This should now handle all cases correctly:
LTR with enough space on right -> shows on right
LTR with not enough space on right but enough on left -> shows on left
LTR with not enough space on either side -> shows on right (may extend beyond viewport)
RTL with enough space on left -> shows on left
RTL with not enough space on left -> shows on right