blackary / streamlit-keyup

Streamlit text input that returns value on keyup
MIT License
166 stars 23 forks source link

Add option to mimic a text area #21

Open pierrelouisbescond opened 1 year ago

pierrelouisbescond commented 1 year ago

Hi @blackary , You did an awesome job with this library! I am working on a project where I'd like to have two text areas synchronized (with, obviously, one transformation between #1 and #2).

My current code is as follows:

import streamlit as st
from st_keyup import st_keyup

value = st_keyup("#1", label_visibility="hidden")

st.text_area("#2", value=value.upper(), height=200, label_visibility="hidden")

Is it feasible to add a parameter like:

value = st_keyup("#1", type="text_area", height=200, "label_visibility="hidden")

I did not spend enough time to fully understand how the library works, but it seems that you are using HTML to mimic Streamlit components, so I assume that it might be feasible.

And I'd be happy to help if I may :-)

blackary commented 1 year ago

This could definitely be done with a bit of work -- I think the best solution would be to add a st_keyup_area function, and add some CSS to make it mimic the native streamlit textarea.

I'd very very happy for someone to add a PR for that, and otherwise I may get around to adding it eventually if there is enough interest.

ilyesTouz commented 1 year ago

I am also working on a similar project, it could be a good feature to add, and it would help me greatly as well

AlexandreVerept commented 1 year ago

Would be a useful feature for sure for chat projects 👍

ATelders commented 1 year ago

I'd also be really interested in this feature, thanks a lot ;)

SamSaver commented 3 days ago

This could definitely be done with a bit of work -- I think the best solution would be to add a st_keyup_area function, and add some CSS to make it mimic the native streamlit textarea.

I'd very very happy for someone to add a PR for that, and otherwise I may get around to adding it eventually if there is enough interest.

Is this functionality currently under development? If not, I would be very interested in working on it!

blackary commented 2 days ago

@SamSaver, nope, not currently -- that would be great if you wanted to work on it!