Giter Site home page Giter Site logo

Comments (3)

jpatte46 avatar jpatte46 commented on June 5, 2024 1

Came here to raise the same issue. For some reason the value is being removed in the backend (shown in my example by printing the value), but it remains in the front end.

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

app = Dash(__name__)
app.layout = html.Div([
        dmc.NumberInput(
            label="Enter a number",
            id="number"
        ),
        dmc.Button(
            children='clear inputs',
            id='clear',
            n_clicks=0
        ),
        html.Div(
            id="value"
        )
])


@callback(
    Output("number", "value"),
    Input("clear", "n_clicks"),
)
def update_value(n_clicks):
    if n_clicks == 0:
        return no_update
    if n_clicks > 0:
        return None


@callback(
    Output('value', 'children'),
    Input("number", "value"),
)
def print_value(number):
    return html.P(f'NumberInput Value: {number}')


if __name__ == "__main__":
    app.run_server(debug=True)

from dash-mantine-components.

snehilvj avatar snehilvj commented on June 5, 2024

If you are using the latest 0.13 alpha releases, then the way to clear a number input is to set its value an empty string instead of None.

from dash-mantine-components.

leberber avatar leberber commented on June 5, 2024

Thank you @snehilvj I have installed v 0.13 and it works

from dash-mantine-components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.