Text_input : how to disable "Press Enter to Apply"

I am using 12 short text_input in a row.
In this situation, the suggestion “Press Enter to Apply” is scrambled.
I would like to avoid having this appearing on the screen.
Is it possible to disable this?
Thanks,
Michel

1 Like

+1

same problem here, can one edit/disable/customize that piece of text in the st.text_input components?

2 Likes

I have added this below code in a separate css file and it works fine for me :raised_hands:t2:

.css-pxxe24 {
visibility: hidden;
}

this disables “Press Enter to Apply”.

Is there any way we can make this a simple parameter

1 Like

how does css interact with a framework in python ??

Dear @Dhanish_Mohd ,

I am desperate to get rid of the “Press Enter to submit form” text of the text_input in streamlit.
I tried to implement your solution my Python code directly via

hide_submit_text = ‘’’

.css-pxxe24 {
visibility: hidden;
}

‘’’
st.markdown(hide_submit_text, unsafe_allow_html=True)

However, this doesn’t bring out any change for me.
I would highly appreciate any suggestion for me what to do.

All the best!

use this:

div[data-testid="InputInstructions"] > span:nth-child(1) {
    visibility: hidden;
}
2 Likes

#Paste the below code after form

import streamlit.components.v1 as components

components.html(
“”"

<script>
const inputs = window.parent.document.querySelectorAll('input');
inputs.forEach(input => {
    input.addEventListener('keydown', function(event) {
        if (event.key === 'Enter') {
            event.preventDefault();
        }
    });
});
</script>
""",
height=0

)

i have the same doubt how to remove press enter to apply

the above css method not working to disable the press enter to apply

Perfect !
It works 100% for me!