Skip to content

Table: expose row position to plugins (aria-rowindex) so useTableRowIndex avoids its own index map #3940

Closed

Description

@humbertovirtudes

Context

Follow-up from review of #3756 (useTableRowIndex).

useTableRowIndex currently has to build its own item → index map because renderCell(item) receives only the row item (no position) and runs during render — there's no row index available at derive time. The plugin works around this by taking the rendered data array and computing a memoized single-pass lookup.

Proposal

If the Table exposed the row's position to plugins — e.g. via aria-rowindex on the <tr> (or a rowIndex passed into the cell render path) — the plugin could read it directly instead of maintaining its own map. That would:

Notes

Raised from @cixzhang's review comment on #3756.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions