scttcper / ngx-color

🎨 Color Pickers from Sketch, Photoshop, Chrome, Github, Twitter & more
https://ngx-color.vercel.app
MIT License
436 stars 55 forks source link

How can we used this component as "disabled"? #338

Open jvegaseg opened 3 years ago

jvegaseg commented 3 years ago

I need use the disable attribute in order to not allow user to modify the field.

With disable attribute it does not work.

Is there any way to do it?

Regards

WongYueKeung commented 3 years ago

in case you using Ng Bootstrap:

 <div class="input-group" ngbDropdown placement="bottom-right">
              <div class="input-group-text px-2">
                <div class="w-20px h-20px rounded" [ngStyle]="{'background-color': wizard.data.colorPresentOnMap}"></div>
              </div>
              <input type="text" class="form-control" value="#00acac" [(ngModel)]="wizard.data.colorPresentOnMap" [disabled]="wizard.data.colorPresentOnMapAuto"/>
              <button class="btn btn-outline-inverse" ngbDropdownToggle [disabled]="wizard.data.colorPresentOnMapAuto"><i class="fa fa-tint"></i></button>
              <div class="dropdown-menu dropdown-toggle w-250px" ngbDropdownMenu>
                <color-sketch color="#00acac" (onChange)="handleChangeColorPresentOnMap($event)"></color-sketch>
              </div>
            </div>