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

[BUG] - Table prop <removewrapper> can't use along with <isvirtualized> #4995

Open
gaozp opened this issue Mar 6, 2025 · 1 comment
Open

Comments

@gaozp
Copy link

gaozp commented Mar 6, 2025

HeroUI Version

2.7.4

Describe the bug

1000 item:

Image
import { Button } from "@heroui/react";
import type { MetaFunction } from "@remix-run/node";

import {  Table,  TableHeader,  TableBody,  TableColumn,  TableRow,  TableCell} from "@heroui/table";

function generateRows(count : Number) {
  return Array.from({length: count}, (_, index) => ({
    key: index.toString(),
    name: `Item ${index + 1}`,
    value: `Value ${index + 1}`,
  }));
}

export const meta: MetaFunction = () => {
  return [
    { title: "New Remix App" },
    { name: "description", content: "Welcome to Remix!" },
  ];
};

export default function Index() {
  const rows = generateRows(1000);
  const columns = [
    {key: "name", label: "Name"},
    {key: "value", label: "Value"},
  ];

  return (
    <Table
      isVirtualized
      isHeaderSticky
      removeWrapper
      aria-label="Example of virtualized table with a large dataset"
      maxTableHeight={500}
      rowHeight={40}
    >
      <TableHeader columns={columns}>
        {(column) => <TableColumn key={column.key}>{column.label}</TableColumn>}
      </TableHeader>
      <TableBody items={rows}>
        {(item) => (
          <TableRow key={item.key}>
            {(columnKey) => <TableCell>{item[columnKey]}</TableCell>}
          </TableRow>
        )}
      </TableBody>
    </Table>
  );
}


Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

import { Button } from "@heroui/react";
import type { MetaFunction } from "@remix-run/node";

import {  Table,  TableHeader,  TableBody,  TableColumn,  TableRow,  TableCell} from "@heroui/table";

function generateRows(count : Number) {
  return Array.from({length: count}, (_, index) => ({
    key: index.toString(),
    name: `Item ${index + 1}`,
    value: `Value ${index + 1}`,
  }));
}

export const meta: MetaFunction = () => {
  return [
    { title: "New Remix App" },
    { name: "description", content: "Welcome to Remix!" },
  ];
};

export default function Index() {
  const rows = generateRows(1000);
  const columns = [
    {key: "name", label: "Name"},
    {key: "value", label: "Value"},
  ];

  return (
    <Table
      isVirtualized
      isHeaderSticky
      removeWrapper
      aria-label="Example of virtualized table with a large dataset"
      maxTableHeight={500}
      rowHeight={40}
    >
      <TableHeader columns={columns}>
        {(column) => <TableColumn key={column.key}>{column.label}</TableColumn>}
      </TableHeader>
      <TableBody items={rows}>
        {(item) => (
          <TableRow key={item.key}>
            {(columnKey) => <TableCell>{item[columnKey]}</TableCell>}
          </TableRow>
        )}
      </TableBody>
    </Table>
  );
}


Expected behavior

Can use this two prop together.

Screenshots or Videos

No response

Operating System Version

macOS

Browser

Chrome

Copy link

linear bot commented Mar 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant