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] Error when calling updateSortState with param sortState as null. #1939

Closed
KiddoV opened this issue Jun 17, 2024 · 0 comments · Fixed by #1964
Closed

[Bug] Error when calling updateSortState with param sortState as null. #1939

KiddoV opened this issue Jun 17, 2024 · 0 comments · Fixed by #1964
Assignees
Labels
bug Something isn't working

Comments

@KiddoV
Copy link

KiddoV commented Jun 17, 2024

Version

v1.2.0

Link to Minimal Reproduction

https://codesandbox.io/p/sandbox/vtable-simple-demo-forked-hgsqc6?file=%2Fsrc%2Findex.ts%3A91%2C42

Steps to Reproduce

  1. Go to the sandbox link.
  2. Click the button.
  3. See the error in console.

Current Behavior

ERROR after calling updateSortState with param sortState as null.

 Uncaught TypeError: Cannot destructure property 'order' of 'this.internalProps.sortState' as it is undefined.
    at ListTable.updateSortState (/node_modules/@visactor/vtable/cjs/ListTable.js:399:182)
    at btnClick (index.ts:75:17)
    at document.getElementById.onclick (index.ts:78:3)

Expected Behavior

NO ERROR after calling updateSortState with param sortState as null. Since the signature of the method accepting null:

updateSortState(sortState: SortState[] | SortState | null, executeSort?: boolean): void;

See https://visactor.io/vtable/api/Methods#updateSortState

Environment

No response

Any additional comments?

No response

@KiddoV KiddoV added the bug Something isn't working label Jun 17, 2024
@fangsmile fangsmile self-assigned this Jun 18, 2024
@fangsmile fangsmile linked a pull request Jun 21, 2024 that will close this issue
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants