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

Skip to content

st.chat_input does not revert to single-line height after multi-line input (Streamlit 1.47.1) #12079

@dslj2017

Description

@dslj2017

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

After entering multiple lines of text into the st.chat_input control, the input box remains at the multi-line height even after sending the message

Image

or clearing the input. It does not shrink back to the original single-line height.

Reproducible Code Example

import streamlit as st
text =  st.chat_input("input")
if text:
    st.write(text)

Steps To Reproduce

Use Streamlit version 1.47.1.
Add st.chat_input to your app, for example:

import streamlit as st
text = st.chat_input("input")
if text:
st.write(text)

Run the app.
In the chat input, enter text that spans multiple lines (e.g., using Shift+Enter).
Send the message (press Enter or click send).
Observe the chat input box.

Expected Behavior

After sending the message, the chat input box should shrink back to its original single-line height if the input area is empty.

Current Behavior

The chat input box remains at the expanded multi-line height, even after sending the message or clearing the input.

Is this a regression?

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

Debug info

  • Streamlit version: 1.47.1
  • Python version: 3.11.8
  • Operating System: Ubuntu 22 LTS
  • Browser: Edge

Additional Information

No response

Metadata

Metadata

Assignees

Labels

feature:st.chat_inputRelated to the `st.chat_input` widgetpriority:P3Medium prioritystatus:confirmedBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions