【问题标题】:How to prevent hex value auto-completion in the ngx-color-picker如何防止 ngx-color-picker 中的十六进制值自动完成
【发布时间】:2022-12-16 02:21:17
【问题描述】:

当在颜色选择器输入中输入有效的十六进制代码时,该字段会添加额外的字符并自动完成。

“ngx-color-picker”版本使用 11.0.0。

<input 
      autocomplete="off"
      name="primaryColor" 
      style.background="#ffffff" 
      cpDisableInput="true"
      [value]="primaryColor"
      [cpAlphaChannel]="'disabled'" 
      [cpFallbackColor]="'#0d6efd'" 
      [cpOutputFormat]="'hex'"
      [cpIgnoredElements]="[ignoredButton]"
      [(colorPicker)]="primaryColor"  
      [(cpToggle)]="cpToggle"
      (colorPickerChange)="updatePrimaryColor($event)" 
      (keyup)="validateColor($event)"
      (change)="validateColor($event)"
/>

【问题讨论】:

    标签: angular


    【解决方案1】:

    希望这有助于找出您的需求 -

        [cpCancelButton]="true"
                [cpSaveClickOutside]="false"
                [cpCancelButtonClass]="'btn btn-danger'"
                [cpOKButton]="true"
                [cpOKButtonClass]="'btn btn-theme-primary'"
                [colorPicker]="classDetails.class_color"
                [cpOutputFormat]="'hex'"
                (cpToggleChange)="ckInputColorChange();"
                [cpAlphaChannel]="'disabled'"
                (colorPickerChange)="validation.color = false; classDetails.class_color = $event"
                (cpInputChange)="classDetails.class_color = $event.value"
                [(ngModel)]="classDetails.class_color"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-15
      相关资源
      最近更新 更多