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

[ic-data-table] Using pagination results in only the slotted elements for the first page being displayed #2867

Open
jw18968 opened this issue Dec 5, 2024 · 0 comments
Labels
type: bug 🐛 Something isn't working

Comments

@jw18968
Copy link

jw18968 commented Dec 5, 2024

Summary of the bug

If you have a paginated table with more than one page of data, and are slotting elements within in a column, moving to the second page will show only the actions for data in the first page.

🪜 How to reproduce

  1. Create an IcDataTable with 20 rows of data and slot in 20 elements that display the row they should be in.
  2. Visit the second page of data and see that, instead of the elements for the second page being displayed, the elements for the first page are displayed.

📸 Screenshots or code

const data = [...new Array(20)].map((_, index) => ({
  index,
  actions: undefined,
}));

function Example() {
  return (
    <IcDataTable
      caption=""
      data={data}
      columns={[
        {
          title: "Index",
          key: "index",
          dataType: "number",
        },
        {
          title: "Actions",
          key: "actions",
          dataType: "element",
        },
      ]}
      showPagination
    >
      {data.map((_, index) => (
        <button key={`actions-${index}`} slot={`actions-${index}`}>
          {index}
        </button>
      ))}
    </IcDataTable>
  );
}

🖥 📱 Device

  • Type: Desktop
  • Device: MacBook
  • OS version: macOS15
  • Browser version: Chrome 131

🧐 Expected behaviour

On the second page of data, I would expect the slotted elements for the second page to be displayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant