Skip to content

[1.49.0] st.dataframe and st.data_editor are not accepting flex layouts values for height #12391

@Vl-Lutsenko

Description

@Vl-Lutsenko

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

Setting height value for st.dataframe/st.data-editor intended for flex layout as described on the page of the update (#11930) will lead to error:

Image

If we try to use mentioned in the error "stretch" value, we still get same error:

Image

Reproducible Code Example

Steps To Reproduce

  1. Create some dataframe, let's say named as test_df, with generated data, so that it has more than 10 rows
  2. Try to render it as st.dataframe or st.data-editor, for example:
    st.dataframe(test_df, height="content", key="testing_flex_layout")

Expected Behavior

st.dataframe element is successfully rendered, and its height is properly adjusted to number of rows our test_df has

Current Behavior

Error message:

streamlit.errors.StreamlitInvalidHeightError: Invalid height value: 'content'. Height must be either an integer (pixels) or 'stretch'.

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.49.0, 1.49.1
  • Python version: 3.13.6
  • Operating System: Windows 10 Enterprise 22H2
  • Browser: Chrome 139.0.7258.155

Additional Information

No response

Metadata

Metadata

Assignees

Labels

area:layoutRelated to layout and positioningfeature:st.dataframeRelated to the `st.dataframe` elementtype: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