Suppress text_area Ctrl-Enter message

I’m using the state method to toggle a text_area widget into a markdown widget using a checkbox:

import streamlit as st
import st_state_patch

state = st.State()

if not state:
    state.text = "A quick brown fox."

edit = st.checkbox('Edit', False)
if edit:
    state.text = st.text_area('Edit', state.text)
else:
    st.markdown(state.text)

But the text_area widget displays “Press Ctrl + Enter to apply” which in this case is not the case. Is it possible to suppress that message? Alternatively, is there a way to use the Ctrl-Enter method to make a smooth transition from text_area to markdown? I tried detecting a change in the text and triggering on that but was unsuccessful. Thanks,

Matt

Hey @mvcalder-xbk, welcome to Streamlit!

Yeah, that message is a bit confusing. What it actually means is, “press ctrl + enter to send the value in this text_area back to streamlit”. In other words, when you press that key combo (or when the text_area loses focus), the browser delivers the contents of the text_area back to your script, which is then re-run with the new text_area value.

In your app’s case, the expected meaning “Press Enter to Apply” is clearly different from the above actual meaning, which is not ideal!

Unfortunately, there’s no way to suppress or change that message, but feel free to open a feature request in Streamlit’s Github repo. Alternately, we have an upcoming plugins feature (discussed on the Streamlit 2020 Roadmap) that will let anyone write their own frontend component that integrates with Streamlit, which will make tailoring this sort of thing possible.