-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fixes Placement of dropdown in many scenarios #109
Fixes Placement of dropdown in many scenarios #109
Conversation
Reason this is problematic, is because profile page is "within panel" when `isSimple: false`. But is "Outside panel" when `isSimple` is set to true (default)
This render hook works and is always considered insidePanel
I've updated the description after removing most of the "ugly" logic for profile page checking. This seems like a great solution to the problem. If this was already evaluated, please do so again. Thanks 🙂 |
@bezhanSalleh A friendly reminder for this PR. If there's a reason this hasn't (or cannot) be merged, please let me know 🙂 |
I thought i wrote back, my bad! So the reason this PR cannot be merged is, you can achieve the same result without it by just doing the following: LanguageSwitch::configureUsing(function (LanguageSwitch $switch) {
$switch
...
->renderHook('panels::user-menu.before')
...;
}); so i'm gonna close it. I'm currently swampped, though i did figure out how to make it work but that's gonna take awhile. maybe after the holidays. |
@bezhanSalleh No worries ❤️ The solution you posted would indeed work. Hopefully it is something you'll eventually are able to get to, but for now it's nice that it can be achieved without hacky-ness! The other item this PR attempted to fix, was the broken alignment for Either way, thanks for the quick response! |
This PR fixes the dropdown menu misplacement in certain scenarios.
Includes:
isSimple: true
$switch->outsidePanelRoutes()
with$panel->profile(isSimple: false)
rendering the language switcher twice as bothisVisibleInsidePanels()
andisVisibleOutsidePanels
returntrue
(Top|Botom)(Center|Right)
outsidePanelPlacement
options which all aligned(Top|Bottom)Left
.auth.profile
from defaultoutsidePanelRoutes()
function as the new render hook is used by both profile styles (simple and non-simple) handling profile as "outside" redundant.Style changes:
// resources/dist/filament-language-switch.css -.w-fit{width:-moz-fit-content;width:fit-content}