Bug Report: Breake Top navigation Dropdown Position #32
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pxlrbt/filament-environment-indicator#32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Description
The
pxlrbt/filament-environment-indicatorplugin causes navigation dropdowns in the topbar to open upwards instead of downwards, pushing them off-screen.Root Cause Analysis
Location:
EnvironmentIndicatorPlugin.php:109-125The plugin injects CSS that adds a border to the topbar:
Why This Breaks Dropdowns
border-topadds 5px (default) to the topbar's total heightReproduction Steps
pxlrbt/filament-environment-indicatorv3.3.1.visible(true)in a Filament panel withtopNavigation()Proposed Solutions
Option 1: Use Pseudo-element (Recommended)
Instead of adding
border-topdirectly to.fi-topbar, use a::beforepseudo-element:Option 2: Use Box-shadow Instead
Replace
border-topwithbox-shadowwhich doesn't affect layout calculations:Option 3: Remove !important Flag
Allow users to override the style if needed:
Workaround (Temporary)
Users can disable the border and keep only the badge:
Environment
topNavigation()modeAdditional Notes
The issue is specific to
topNavigation()mode because:Suggested PR Changes
File:
src/EnvironmentIndicatorPlugin.phpLines: 118-124
Replace the current CSS injection with Option 1 (pseudo-element) or Option 2 (box-shadow) solution.
I tried to replicate this in Firefox, Chrome and Safari on macOS but I don't get this issue. Can you share a screenshot or some example?
Hi @pxlrbt , thank you for investigating!
I created a minimal example repo that shows the issue. I added this plugin and guava/filament-knowledge-base as dependencies.
https://github.com/larsbo/environment-indicator-issue-example
If you toggle the border setting in the panel provider you can see the different behaviour of the dropdown menu next to the profile icon.
PS: I noticed that the profile dropdown is not affected but I don't see a difference of the two dropdowns.
@larsbo Thanks for the repo. I found the difference in the Knowledge Base plugin's dropdown and the user dropdown and opened a PR for the plugin. As this is not a problem with this plugin, I'll close this issue.
Awesome, thank you @pxlrbt !