Replies: 4 comments 3 replies
-
At the moment, Flop Phoenix will always produce pagination links with |
Beta Was this translation helpful? Give feedback.
-
Coming back to this, since I never replied to it apparently. The context is that we have 2 phoenix apps that have some live view added after the facts using live_render. This makes it impossible to use the handle_params/3, since that only works if the entire page is a liveview page. The pagination therefore doesnt work, as I cannot provide a handle_params function. |
Beta Was this translation helpful? Give feedback.
-
A user reported a bug where pagination failed again, so I remembered this thread. I found some working code that temporarily fixes the issue with pages that contain a bit of live view. Usually, I'd write the following:
But I changed it to this workaround, but that no longer seems to work:
|
Beta Was this translation helpful? Give feedback.
-
Finally got something working here: <div class="flex justify-center my-4" phx-update="ignore" id="client-invoicing-nav">
<%= if @meta.has_previous_page? do %>
<a
href={
Flop.Phoenix.Pagination.build_page_link_helper(
@meta,
~p"/admin/invoicing/client-invoicing/#{@type}"
).(@meta.previous_page)
}
aria-label="Go to previous page"
class="page-link"
>
<<
</a>
<% else %>
<span aria-label="Go to previous page" class="page-link disabled">
<<
</span>
<% end %>
<%= if @meta.has_next_page? do %>
<a
href={
Flop.Phoenix.Pagination.build_page_link_helper(
@meta,
~p"/admin/invoicing/client-invoicing/#{@type}"
).(@meta.next_page)
}
aria-label="Go to next page"
class="page-link"
>
>>
</a>
<% else %>
<span aria-label="Go to next page" class="page-link disabled">
>>
</span>
<% end %>
</div> |
Beta Was this translation helpful? Give feedback.
-
We are using Flop for all our pagination needs, and only a few pages use LiveView components.
It seems to be impossible to force Flop pagination to not use LV at this point when the page contains some LV components.
Is there any way to do this?
Currently I manually built the navigation form using
Flop.Phoenix.CursorPagination.pagination_path
.Beta Was this translation helpful? Give feedback.
All reactions