Skip to content

Conversation

smaspe
Copy link

@smaspe smaspe commented May 28, 2025

Fix #6025

the onChange in the memo options is always called once on initialization, for each model.

Several models enqueue a call to _autoResetPageIndex (core model, sorted model, grouped model), which are all resolved together in a Promise. They should all evaluate registered === false.

However, because the call in getGroupedRowModel is wrapped in another layer of _queue:

getMemoOptions(table.options, 'debugTable', 'getGroupedRowModel', () => {
table._queue(() => {
table._autoResetExpanded()
table._autoResetPageIndex()
})
})

the call to _autoResetPageIndex actually resolves later, once registered is true, and it calls table.resetPageIndex().

The wrap in _queue is also not present in

getMemoOptions(table.options, 'debugTable', 'getRowModel', () =>
table._autoResetPageIndex()
)
or in
getMemoOptions(table.options, 'debugTable', 'getSortedRowModel', () =>
table._autoResetPageIndex()
)

As far as I can tell it should not be there.

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

Successfully merging this pull request may close these issues.

GroupedRowModel is incompatible with Pagination
1 participant