Skip to content

T1337363 - DataGrid — E1046 is thrown when state is restored without columns and a row is focused - #36046

Open
bit-byte0 wants to merge 2 commits into
DevExpress:mainfrom
bit-byte0:fix/t1337363-state-restore-focused-row-e1046-main
Open

bit-byte0 wants to merge 2 commits into
DevExpress:mainfrom
bit-byte0:fix/t1337363-state-restore-focused-row-e1046-main

Conversation

@bit-byte0

Copy link
Copy Markdown
Contributor

What

DataGrid no longer raises E1046 when state() drops runtime grouping while a row is focused

How

Focus data controller keeps only the last of several queued updateFocusedRow changes, so endUpdate no longer merges them into a full refresh over stale grouped items

&& this.changes.every((change) => change.changeType === 'updateFocusedRow');

if (isUpdateFocusedRow) {
this.changes = [this.changes[this.changes.length - 1]];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick

Suggested change
this.changes = [this.changes[this.changes.length - 1]];
this.changes = [this.changes.at(-1)];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at(-1) can return undefined, so TS won't let it go into this.changes. used slice(-1) instead - also short, and no ! needed

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants