question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unclear on dcc.Input type argument effect

See original GitHub issue

I assumed that dcc.Input(..., type='number') would return the contents as an int or float. My request:

  • if this is false and dcc.Input are always of type str, could this be made more clear in the docs?

  • if this should be the case, could someone take a look at what’s going on?

  • in either case, could the docs be more clear about the effect of the type argument? At present it simply says “The type of control to render.” I’m starting to suspect it only affects a minor appearance of the input box.

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chriddypcommented, Nov 24, 2017

@Madhu94 @jwhendy - Thanks for reporting! Sorry about this - the build on 0.15.0 was bad. I’ve updated this on v0.15.2, so give this a try:

pip install dash-core-components==0.15.2
import dash
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash()

app.layout = html.Div([
    dcc.Input(id='input', type='number'),
    html.Div(id='output')
])


@app.callback(
    dash.dependencies.Output('output', 'children'),
    [dash.dependencies.Input('input', 'value')])
def update_output(value):
    print type(value)
    return value


if __name__ == '__main__':
    app.run_server(debug=True)
0reactions
jwhendycommented, Nov 25, 2017

Rockin! I just replicated @Madhu94 's example from #124 and it works like a charm now. Thanks for the quick fix!

2017-11-24_182002

Read more comments on GitHub >

github_iconTop Results From Across the Web

dcc.Input - Dash for Python Documentation - Dash Plotly
that the user can enter. For other control types, it is ignored. It can exceed the value of the size attribute.
Read more >
Plotly-Dash How to Use dcc.Input to pass input as JSON ...
Hi everyone I am trying to build an interface for my scraper application and I am having a difficult time with passing user...
Read more >
Dash User Guide and Documentation
Dash is a productive Python framework for building web applications. Written on top of Flask, Plotly.js, and React.js, Dash is ideal for building...
Read more >
User inputs in Dash components | Python - DataCamp
A user input is a dash_core_components Input type ( dcc.Input ). An id is required for callback usage; The type will default to...
Read more >
Bug listing with status RESOLVED with resolution FIXED as at ...
Bug listing with status RESOLVED with resolution FIXED as at 2022/12/17 06:46:03 ... Bug:1407 - "pcmcia generates 'tty: standard input: Invalid argument' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found