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

can't access property "length", a.sharedService.visibleColumns is undefined when hiding column #1180

Closed
5 tasks done
Elias-Graf opened this issue Jun 30, 2023 · 3 comments · Fixed by #1181
Closed
5 tasks done
Labels

Comments

@Elias-Graf
Copy link

Elias-Graf commented Jun 30, 2023

Describe the bug

The error can't access property "length", a.sharedService.visibleColumns is undefined is printed to the console, after moving a column, and then hiding one of the columns.

Reproduction

  1. Go to: https://ghiscoding.github.io/Angular-Slickgrid/#/draggrouping
  2. Move "Title" column to the second position (after: "Duration")
  3. Hide the "Title" column (or any other) via right-click and removing the check

Expectation

No error should be thrown.

Environment Info

Environment: https://ghiscoding.github.io/Angular-Slickgrid/#/draggrouping
Browser: Firefox / Chrome
OS: Windows 11

Validations

@ghiscoding
Copy link
Owner

ghiscoding commented Jun 30, 2023

The issue does not show up if you refresh the page, it only shows when coming from another page. So there's probably some leaking somewhere of something that wasn't disposed or destroyed before routing to another page. It seems to point to SortableJS code throwing and the error comes from this line in the SortableJS github code
https://github.com/SortableJS/Sortable/blob/7af63fdc5d7512e7f0b8abb10970d473521b31a5/Sortable.js#L1115

Also probably related to this other SortableJS issue and a user also mentioned SlickGrid as well in that issue
SortableJS/Sortable#2201

ghiscoding added a commit to ghiscoding/slickgrid-universal that referenced this issue Jun 30, 2023
- this fixes 2 issues identified in Angular-Slickgrid, ghiscoding/Angular-Slickgrid#1180
- when leaving a SPA page and going back to it, it could throw a bunch of errors. We simply need to make sure that any sortable instances are destroyed before recreating any new ones
ghiscoding added a commit to ghiscoding/slickgrid-universal that referenced this issue Jul 1, 2023
- this fixes 2 issues identified in Angular-Slickgrid, ghiscoding/Angular-Slickgrid#1180
- when leaving a SPA page and going back to it, it could throw a bunch of errors. We simply need to make sure that any sortable instances are destroyed before recreating any new ones
ghiscoding added a commit that referenced this issue Jul 1, 2023
…rtable-errors

fix(grouping): DraggableGrouping could throw when leaving page, fixes #1180
@ghiscoding
Copy link
Owner

fixed in v6.0.1

@ghiscoding ghiscoding added the bug label Jul 1, 2023
@ghiscoding
Copy link
Owner

you could also star the project if you like the lib 😉 ⭐

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants