snehilvj / dash-mantine-components

Plotly Dash components based on Mantine React Components
https://www.dash-mantine-components.com
MIT License
492 stars 44 forks source link

The dmc.ColorPicker doesn't show the color when it's value is updated #259

Open jincheeva opened 1 month ago

jincheeva commented 1 month ago

The color picker works well when we pick a color. However, when we set the color value to the component, it doesn't display that color. Please use the following code to replicate the issue:

import dash_mantine_components as dmc import dash_bootstrap_components as dbc from dash import Dash, html, Input, Output, callback

app = Dash(name)

app.layout = html.Div( [ dmc.ColorPicker(id="color-picker", format="hex"), dbc.Input(id="color-input", debounce=True), ] )

@app.callback( Output("color-picker", "value"), Input("color-input", "value"), ) def input_(color): return color

if name == "main": app.run(debug=True)

snehilvj commented 4 days ago

Hi @jincheeva I can't reproduce the issue. Can you share a demo?

https://github.com/snehilvj/dash-mantine-components/assets/91216500/abb0bc64-fd7e-4353-855b-e201cce3e693

jincheeva commented 4 days ago

Thank you for your response. This is the video of the screen when we run the code below. We set the initial value of the colorpicker to be "#343353" but the colorpicker shows the white color in the upper left corner. https://github.com/snehilvj/dash-mantine-components/assets/168907889/ee45d17e-a72d-45c3-b412-ed5359f3a4d2

import dash_mantine_components as dmc from dash import Dash, Output, Input, html, callback

app = Dash()

app.layout = html.Div( [ dmc.ColorPicker(id="color-picker", format="hex", value="#343353"), dmc.Space(h=10), dmc.Text(id="selected-color"), ] )

@callback(Output("selected-color", "children"), Input("color-picker", "value")) def pick(color): return color

if name == "main": app.run(debug=True)

snehilvj commented 16 hours ago

I don't face this issue in the latest version of dmc. Can you please confirm your version?

jincheeva commented 7 hours ago

Thank you so much for your investigation and your reply. I was using version 0.12. After switching to version 0.14, I can confirm that the issue has been resolved. The colorpicker works well in version 0.14. Thank you so much.