-
Notifications
You must be signed in to change notification settings - Fork 44
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
Navigation Item Current Attribute dropped on dispatched event. #918
Comments
@kyledoesdev That's happening because your navigation item is a Livewire component containing the event listener thus it is getting re-rendered when the event is dispatched and, at that point, the route is I believe if you move the layout-level:
livewire/navigation-badge.blade.php
|
This somewhat patches the problem, but the badge is now not included in the accent underline of the nav item because it's a sperate badge being rendered. This works, it just doesn't have that fluid look to it: |
@kyledoesdev We're getting closer... I'll give this a think. |
Sounds good, I am going to continue to tinker with it as well. |
@kyledoesdev Just heading out, but what about moving the word 'Invitations' into the component's render so the component is responsible for the entire menu prompt? |
I think that'll do it. I can throw some tailwind on the badge to scale it better. But I can go with this one for now: 2024-12-22.12-52-21.mp4 |
@kyledoesdev thanks for reporting! @jeffchown is correct, on update, request has changed, so the current route no longer matches. Caleb recently added So even if you manage to find a work around, I think you should leave this open, so we can see if we can get Flux using something like |
Sounds good Josh! Let's leave it open for now. The work-around that @jeffchown suggested above is working fine for now for me. |
Flux version
1.1
Livewire version
3.5.17
What is the problem?
When an event is dispatched from a component to another component, the :current Attribute on a navigation item seems to drop off. Attached is a demo video of this happening.
2024-12-22.12-09-03.mp4
Code snippets
Attached are the files involved with this issue:
Navigation Badge Livewire Component
Navigation Component Template
Model getPending query function.
Navigation Layout Header.
Invite approved function that dispatches event:
How do you expect it to work?
I expect it to when the event is dispatched, the count of the badge in the navigation item to be updated without the theming underline disappearing. The current route did not change.
Please confirm (incomplete submissions will not be addressed)
The text was updated successfully, but these errors were encountered: