Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Consider setting default min/max values for st.number_input in integer modeΒ #6740

@vdonato

Description

@vdonato

Problem

We currently have some guards in the Python backend preventing user scripts from creating integer
st.number_input widgets with values that exceed javascript's min/max integer values. However, this
doesn't prevent users from inputting larger values in the web UI, which results in weird and unexplained
value truncation.

Solution

A potential solution to this issue would be to by default set the st.number_input min/max value kwargs
to -2**53+1/2**53-1 when the widget is running in integer mode. This is definitely better than truncating
values with no explanation, but the downside to doing something like this is that the fully-expanded values look
like arbitrary numbers unless you just happen to know what javascript's min/max int values are when entirely
written out.

Additional context

See the discussion in the comments of #6724


Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.

If you'd like the Streamlit team to prioritize this feature request, please use the πŸ‘ (thumbs up emoji) reaction in response to the initial post.

Metadata

Metadata

Assignees

Labels

area:widgetsRelated to widget elementsfeature:st.number_inputRelated to the `st.number_input` widgettype:enhancementRequests for feature enhancements or new features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions