I have a list / detail layout on a Livewire app on the route /items/{id}
.
When selecting an item on the list, I’d like to get URLs like /items/1
, /items/2
, etc. but keep the list scroll position as it is.
Three unsatisfying solutions to do that:
- Using a classical href navigation, but the page will reload and I will lose the scrolling state of my list
- Using
wire:navigate
andwire:scroll
, but I still get a reset of the scroll position as the component is re-rendered - Using a $id property to load the details + #[Url], but the url will look like
/items?id=1
and not/items/{id}
Is there a livewire way to update the route parameters when updating properties ?