Text_input widget R2L

Hi folks,
I’m using the text_input widget, it’s default behavior is representing the typed text in Left to Right direction (which legit for the English language).

But in my case, I expect the user to insert not an English text - but a Right 2 Left direction text, which seems very strange when it viewed in the opposite way.

Any flag or workaround to avoid it?
Thanks!

Hi @Daniel_Juravski,

Looks like you can do this as a workaround.

import streamlit as st

st.markdown("""
<style>
input {
  unicode-bidi:bidi-override;
  direction: RTL;
}
</style>
    """, unsafe_allow_html=True)

i1 = st.text_input("text input 1")
st.write('value 1: "', i1, '"')

Feel free to file a feature request if you feel it’s needed!

2 Likes

Hi @Jonathan_Rhone,
That worked like a magic!

Thanks!