Skip to content

Bug in @preact/signals v2.0.1 and v1.3.2 breaking material-react-table and @material-table/core functionality #650

Closed
@pinchasr2022

Description

@pinchasr2022
  • Check if updating to the latest version resolves the issue
    current: 2.0.1

Environment

  • I am using @preact/signals-core
  • I am using @preact/signals
  • I am using @preact/signals-react

Describe the bug
There is a bug introduced in versions @preact/signals 2.0.1 and 1.3.2, where certain table functionalities in popular libraries like material-react-table and @material-table/core stop working correctly. Specifically:

  • In material-react-table (v3.1.0), the search bar doesn't open when clicked, and core features like sorting, filtering, and grouping fail to function.
  • In @material-table/core (v6.4.4), the detailPanel feature, which expands table rows to show additional details, also breaks.

The bug is triggered when importing the functions computed or signal from @preact/signals, even if they are not actively used in the code. For example, the following import statement causes the issue:

import { computed, signal } from "@preact/signals";

To Reproduce
Please refer to my GitHub repository for a project demonstrating the issue:
GitHub Repository for Reproducing the Bug
Although the issue affects both libraries, my GitHub repository demonstrates the issue specifically with material-react-table.

Issue with material-react-table (Multiple Issues):

Steps to reproduce the behavior:

  1. Import computed or signal from @preact/signals:
import { computed, signal } from "@preact/signals";
  1. Implement the MaterialReactTable component in your project.
import { MaterialReactTable } from "material-react-table";

const Table = () => (
  <MaterialReactTable
    columns={[
      {
        accessorKey: "firstName",
        header: "First Name",
      },
      {
        accessorKey: "lastName",
        header: "Last Name",
      },
    ]}
    data={[
      {
        firstName: "John",
        lastName: "Doe",
      },
      {
        firstName: "Kevin",
        lastName: "Vandy",
      },
    ]}
  />
);

export default Table;
  1. Try using the search bar or the built-in features like filtering, sorting, grouping, etc.
  2. Issue: Clicking on the search bar does not open it, and other built-in features like filtering, sorting, and grouping do not work properly.

Issue with @material-table/core (Single Issue):

Steps to reproduce the behavior:

  1. Import computed or signal from @preact/signals:
import { computed, signal } from "@preact/signals";
  1. Implement the MaterialTable component in your project.
import MaterialTable from "@material-table/core";

const Table = () => (
  <MaterialTable
    columns={[
      {
        field: "firstName",
        title: "First Name",
      },
      {
        field: "lastName",
        title: "Last Name",
      },
    ]}
    data={[
      {
        firstName: "John",
        lastName: "Doe",
        email: "john@doe.com",
      },
      {
        firstName: "Kevin",
        lastName: "Vandy",
        email: "kevin@vandy.com",
      },
    ]}
    detailPanel={({ rowData }) => <div>{rowData.email}</div>}
  />
);

export default Table;
  1. Try using the detailPanel feature.
  2. Issue: The detailPanel feature does not expand the row to show additional details.
    Expected behavior
    When importing @preact/signals, table functionalities like search bars, sorting, filtering, and detailPanel should continue to work as expected, without any interruptions or malfunctions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions