Skip to content

Nav button labels direction issue xs screen #3

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

Open
AlecBytes opened this issue Mar 2, 2025 · 1 comment
Open

Nav button labels direction issue xs screen #3

AlecBytes opened this issue Mar 2, 2025 · 1 comment

Comments

@AlecBytes
Copy link

"absolute hidden peer-hover:block px-2 py-1 left-full mx-2 top-1/2 -translate-y-1/2 bg-background text-foreground text-sm rounded-md shadow-lg whitespace-nowrap",

The left-full in the className string is overriding the conditional labelDirection. To fix just remove left-full from line 109.

Image

@krishna1505
Copy link

🛠️ Tooltip Direction Fix (XS Screen)
The tooltip on nav buttons using labelDirection === "left" with right-full was overflowing off-screen on extra small (XS) devices. Also, using mx-2 caused misalignment issues.

✅ Fix:

Replaced mx-2 with directional margins (ml-2 / mr-2) based on tooltip side.

Added max-xs:left-full for better responsive behavior.

Included z-50 to keep tooltip above other UI layers.

Verified Tailwind theme tokens for bg-background and text-foreground.

<span
className={clsx(
"absolute hidden peer-hover:block px-2 py-1 top-1/2 -translate-y-1/2 bg-background text-foreground text-sm rounded-md shadow-lg whitespace-nowrap z-50",
labelDirection === "left"
? "right-full left-auto mr-2 max-xs:right-auto max-xs:left-full max-xs:ml-2"
: "left-full ml-2"
)}

{label}

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

No branches or pull requests

2 participants