Skip to content
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

Stop pagination elements from overflowing outside of panel container #7599

Merged

Conversation

ray-curran
Copy link
Contributor

@ray-curran ray-curran commented Jul 20, 2022

When a paginated table is placed inside a panel, the pagination elements
are floated and overflow outside the panel. Adding clearfix expands the
panel to include the pagination elements.

Fixes #6880

Before:
Screen Shot 2022-07-20 at 4 36 18 PM

After:
Screen Shot 2022-07-20 at 4 25 34 PM

To Replicate:

  • Update dashboard.rb with the following content:
# frozen_string_literal: true
ActiveAdmin.register_page 'Dashboard' do
  menu priority: 1, label: proc { I18n.t('active_admin.dashboard') }

  content title: proc { I18n.t('active_admin.dashboard') } do
    if current_admin_user.super_admin?
      columns do
        column do
          panel 'Updated contents by Admins' do
            paginated_collection(Post.all.order(id: :desc).page(params[:page]).per(2), download_links: true) do
              table_for(collection, sortable: false) do
                column 'Item', :item
                column(:item_type) { |v| v.title }
                column 'Event', :event
                column('Modified At') { |v| (v.created_at.to_s :long).html_safe }
              end
            end
          end
        end
      end
    end
  end
end


When a paginated table is placed inside a panel, the pagination elements
are floated and overflow outside the panel. Adding clearfix expands the
panel to include the pagination elements
Copy link
Member

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Copy link
Member

@javierjulio javierjulio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@javierjulio javierjulio merged commit 0822e91 into activeadmin:master Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to fix pagination links UI on Dashboard
3 participants