Ng-select: Disable Issue

Created on 10 Oct 2017  路  4Comments  路  Source: ng-select/ng-select

Hi, anjmao
I face a problem about multi select disable, when the ngSelect inside FormGroup tag and modal, it wont disable the multi select. so how can fix it?

More Info

ng-select version: [0.2.5]

browser: [Google Chrome]

reproducable in demo page: [YES]

question

Most helpful comment

@mi1olson It appears that then using reactive forms you should disable it using form control API and [disabled] attribute wont work, this is how angular reactive forms work. I added this sample to demo page also.

    togglePhotoDisabled() {
        const photo = this.heroForm.get('photo');
        if (photo.disabled) {
            photo.enable();
        } else {
            photo.disable();
        }
    }

All 4 comments

@mi1olson Thanks for reporting, I'm looking into it :)

@mi1olson It appears that then using reactive forms you should disable it using form control API and [disabled] attribute wont work, this is how angular reactive forms work. I added this sample to demo page also.

    togglePhotoDisabled() {
        const photo = this.heroForm.get('photo');
        if (photo.disabled) {
            photo.enable();
        } else {
            photo.disable();
        }
    }

Thank You very much Mr Anjmao. :)
its works for me

@anjmao thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ybmt picture ybmt  路  3Comments

iantrudell picture iantrudell  路  3Comments

ejasarevic picture ejasarevic  路  3Comments

gitlines picture gitlines  路  4Comments

vincentjames501 picture vincentjames501  路  4Comments