-
-
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
Flop.Phoenix.pagination change to allow not to render next/prev links #270
base: main
Are you sure you want to change the base?
Flop.Phoenix.pagination change to allow not to render next/prev links #270
Conversation
* add ability to specify that you do not wanter to render next and previous links
FYI. I was able to solve the same thing with the built in options. For example, I hid the page numbers with: def pagination_opts do
[
pagination_list_attrs: [class: "hidden"],
]
end |
Do you still think the changes in this PR would be useful, or are you happy with the CSS solution? |
I am personally happy with the CSS solution, but curious to hear what @oliverswitzer thinks. |
Hey friends, sorry, been a busy couple of weeks! To be clear I wasn't hoping to hide page numbers entirely, which seems like what the solution @cadebward was recommending ( Even if I try to hide the previous and next buttons with setting I think next/prev elements need to not be rendered in the DOM entirely to fix this issue. |
@@ -186,7 +186,8 @@ defmodule Flop.Phoenix do | |||
Default: `#{inspect(Pagination.default_opts()[:wrapper_attrs])}`. | |||
""" | |||
@type pagination_option :: | |||
{:current_link_attrs, keyword} | |||
{:render_next_and_previous_links, boolean()} | |||
| {:current_link_attrs, keyword} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little nitpick, the options here are in alphabetical order, can you move the new option to the right position?
@@ -8,6 +8,7 @@ defmodule Flop.Phoenix.Pagination do | |||
@spec default_opts() :: [Flop.Phoenix.pagination_option()] | |||
def default_opts do | |||
[ | |||
render_next_and_previous_links: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list is alphabetically sorted as well. 🔤
Alright, let's add the option. I just had two small comments. |
Description
Thanks for making this awesome library!
This PR adds the ability to specify that you do not wanter to render next and previous links.
Background: we're experiencing a styling conflict with our UI library daisyUI that causes the nubmered pages left border radius to get cut off when next / prev links are rendered (which we do not want).
This feature allows you to disable rendering those buttons if they aren't wanted.
Checklist