Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dcc.Input type="color" raises error #2772

Open
luggie opened this issue Mar 1, 2024 · 4 comments
Open

dcc.Input type="color" raises error #2772

luggie opened this issue Mar 1, 2024 · 4 comments
Assignees

Comments

@luggie
Copy link

luggie commented Mar 1, 2024

dcc.Input(type="color")

is implemented and works correctly. However the components description, doc string (except for on ReadOnly section) and type checking is not up to date as it raises:

Invalid argument `type` passed into Input with ID "set-color-input".
Expected one of ["text","number","password","email","range","search","tel","url","hidden"].
Value provided: "color"
@alexcjohnson alexcjohnson transferred this issue from plotly/dash-core-components Mar 1, 2024
@alexcjohnson
Copy link
Collaborator

Thanks @luggie (transferred the issue to dash, dcc has been merged in here so the other repo is obsolete)

When you say it's implemented, you mean it works correctly if you disable prop checking? If so, we should be able to just add color as an option here:

type: PropTypes.oneOf([
// Only allowing the input types with wide browser compatibility
'text',
'number',
'password',
'email',
'range',
'search',
'tel',
'url',
'hidden',
]),

We will want to check on the comment // Only allowing the input types with wide browser compatibility - perhaps when we first wrote this component color was poorly supported but now it's close to universal?

@AnnMarieW
Copy link
Collaborator

One issue with adding the color prop is that if someone clicks and drags on the color picker, it will fire the callback a bazillion times. Not sure if there is a way to prevent that, or maybe just recommend people use this option in a clientside callback only?

@alexcjohnson
Copy link
Collaborator

dcc.Input has a debounce prop, which should help with that.

@luggie
Copy link
Author

luggie commented Mar 2, 2024

When you say it's implemented, you mean it works correctly if you disable prop checking? If so, we should be able to just add color as an option here:

yep, that's what I thought

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

No branches or pull requests

4 participants