Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Disable hex input auto completing #323

Closed
cindi123 opened this issue Dec 16, 2020 · 4 comments
Closed

Disable hex input auto completing #323

cindi123 opened this issue Dec 16, 2020 · 4 comments

Comments

@cindi123
Copy link

Description

If you type characters directly into the hex input field, it will autocomplete. For example if I type 123 it will autocomplete the field by setting the value to 112233. When you try and delete some characters to change the entry it just continues to autocomplete them. Do not run the setValue() function unless the field loses focus OR there are at least 6 characters in the field. This is driving users crazy. I think you fixed this in your previous version here: zefoy/ngx-color-picker#84. Version 3.2 doesn't have the same fix.

Context

  • bootstrap-colorpicker version: 3.2
  • bootstrap version: 4
  • jQuery version: jQuery v3.5.1
  • Browser name and version: Firefox
  • Operative System name an version: Mac OsX

Live Example

You can see this in action on the example page for the plugin - try clearing out the hex value in the "Add complementary color swatches" example and start typing any number or letter and see what it does:
https://itsjavi.com/bootstrap-colorpicker/tutorial-p02_Advanced_Examples.html

@heliobentes
Copy link

Same issue here

@erehulka
Copy link
Contributor

erehulka commented Feb 8, 2021

Have you tried

...
$('#colorpicker').colorpicker({
  autoInputFallback: false
});
...

To be fair it still doesn't work for me, but you can try this setting, maybe it will somehow work for you..

@iameddz
Copy link

iameddz commented Mar 15, 2021

I've fixed this Issue for the hex-format in the update-function (Line 4653):

var originalColor = this.colorpicker.color._original.color;
if (originalColor.length < 7 && originalColor.startsWith('#')) {
  return;
}

@itsjavi
Copy link
Owner

itsjavi commented Apr 23, 2021

That's how the color parsing library works (unfortunately). I think there is a PR from @erehulka that will solve this with an option.
thanks for taking care of that in #325

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants