ngx-sortablejs icon indicating copy to clipboard operation
ngx-sortablejs copied to clipboard

Restricted ngOnChanges to only run when able

Open blackbaud-conorwright opened this issue 4 years ago • 9 comments

Fixes: #172

Added condition that the sortableInstance has already been instantiated, before it can be used in the ngOnChanges method. Should resolve the error from this issue where ngOnChanges executes and breaks before sortableInstance actually exists.

I didn't see a CONTRIBUTING.md or any contribution information in the README, so please let me know if this is at all welcome and if there's anything else you need me to update such as the version in package.json/package-lock.json (is 0, so I assume no) or the changelog.

blackbaud-conorwright avatar Jul 15 '20 14:07 blackbaud-conorwright

@smnbbrv and @kamilchlebek Sorry to tag you two, but I see some other unmerged PRs with no maintainer discussion on them that have been open for some time. One of which is actually approved, but unmerged. You two are the most recently merged commits, so I hoped you might be able to help review this or find it a reviewer. I am currently blocked by this issue and would prefer not to have to wait for weeks or indefinitely on it.

blackbaud-conorwright avatar Jul 15 '20 14:07 blackbaud-conorwright

Please have a look at #197

smnbbrv avatar Jul 15 '20 18:07 smnbbrv

Ah dang, I see. We'll probably make a private fork then and work our way off the dependency. Thank you though 👍

blackbaud-conorwright avatar Jul 15 '20 18:07 blackbaud-conorwright

@blackbaud-conorwright: Are you planning to make a fork and a npm release?

MortenHe avatar Jul 30 '20 10:07 MortenHe

I am not planning on releasing and maintaining a public version, sorry. I made a private fork with my fixes and am actively working on moving away from the dependency altogether. If you need the fix, I'd recommend pulling down this PR's branch and doing the same unless you are willing to take over ownership/maintenance of this project.

blackbaud-conorwright avatar Jul 30 '20 18:07 blackbaud-conorwright

@blackbaud-conorwright: Thanks for your reply? You said you're moving away from the dependency. Do you have an alternative npm package that you recommend or how will you do sorting in the future? Thanks in advance for your reply.

MortenHe avatar Jul 31 '20 08:07 MortenHe

You can use @angular/cdk drag and drop implementation https://material.angular.io/cdk/drag-drop/overview

It is quite easy to use, very flexible and created by Angular team specifically for Angular. That's what I am using now.

SortableJS is quite old, has limited API and is really painful to support; especially when it comes to Angular. This, and the fact there is "official way" to do it, are the reasons I stopped developing this project.

smnbbrv avatar Jul 31 '20 09:07 smnbbrv

You can use @angular/cdk drag and drop implementation https://material.angular.io/cdk/drag-drop/overview

It is quite easy to use, very flexible and created by Angular team specifically for Angular. That's what I am using now.

SortableJS is quite old, has limited API and is really painful to support; especially when it comes to Angular. This, and the fact there is "official way" to do it, are the reasons I stopped developing this project.

True but some things still can't be done easily with Angular Material drag and drop like flexbox wrapped lists. Whereas with sortableJS it's piece of cake.

ddenoel avatar Oct 28 '20 14:10 ddenoel

Hi there, what's a status of this pr?

dmmishchenko avatar Apr 05 '23 11:04 dmmishchenko