hughjdavey / ngx-stars

Simple stars rating component for Angular >= 2
Creative Commons Zero v1.0 Universal
18 stars 9 forks source link

When `readonly` should not set stars to 0 #12

Closed gonzalo-lorieto closed 1 year ago

gonzalo-lorieto commented 1 year ago

For the ones having this issue, you can workaround it by doing this in the parent component:

    ...
    @ViewChild(NgxStarsComponent)
    starsComponent: NgxStarsComponent;
    ...
    ngAfterViewInit(): void {
        if (this.starsComponent.readonly) {
            this.starsComponent.onZeroStarClick = (): void => {};
        }
    }
hughjdavey commented 1 year ago

Release 1.6.4 is on npm now containing this fix. Thanks again @gonzalo-lorieto

gonzalo-lorieto commented 1 year ago

@hughjdavey can you bump v 1.5.1 with this fix?

hughjdavey commented 1 year ago

@gonzalo-lorieto Unfortunately I don't think npm allows editing or deleting published versions. Why do you want in 1.5.1? I guess I could make a 1.5.2?

gonzalo-lorieto commented 1 year ago

@gonzalo-lorieto Unfortunately I don't think npm allows editing or deleting published versions. Why do you want in 1.5.1? I guess I could make a 1.5.2?

Exactly, create the 1.5.2 version with this fix. Latest version doesn't work for my project. Thanks!

hughjdavey commented 1 year ago

So what is the latest version that works for you? 1.5.1 was the release where I disabled the Ivy compiler, so if that works for you, then the latest release should too

gonzalo-lorieto commented 1 year ago

@hughjdavey 1.5.1 works but 1.6.x doesn't

hughjdavey commented 1 year ago

Which 1.6.x releases have you tried? 1.6.3 fixed an issue with importing the library from other projects - so if you have only tried <1.6.3 that could be the reason? Can you let me know if >=1.6.3 works for you, and if not, the error/s you are getting and what version of Angular you are using? Thanks very much