Skip to content

[BUG] dash bootstrap input component with type number fails to output 0 value #1017

@legendsam

Description

@legendsam

subject
DBC 0 value

**reproducible example **

import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
import dash
from dash.dependencies import Input, Output

app = dash.Dash(__name__) # external_stylesheets=[dbc.themes.BOOTSTRAP])
app.layout = html.Div(
    [
        html.Div("dCc component"),
        dcc.Input(id="dcc", type="number"),
        html.Div("dBc component"),
        dbc.Input(id="dbc", type="number"),
        html.Div("Result"),
        html.Div(id="number-out"),
    ]
)

@app.callback(
    Output("number-out", "children"),
    [Input("dcc", "value"),Input("dbc", "value"),Input("dcc", "n_submit")],
)
def number_render(fval,fval2,btn):
    print(fval,fval2,btn)
    return "DCC : {}".format(fval)+" "+"DBC : {}".format(fval2)

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

configuration
dash-auth (1.3.2)
dash-bootstrap-components (0.7.1)
dash-core-components (1.3.1)
dash-html-components (1.0.1)
dash-renderer (1.1.2)
dash-table (4.4.1)

Browser Google Chrome Version 77.0.3865.120 windows
or Firefox 65.0.1 (32 bits) windows

Describe the bug
DBC input returns None when 0 is filled
It's impossible to know that 0 has been entered for DBC input.

Expected behavior
as for DCC input, it should return 0 when 0 is filled

Screenshots
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions