streamlit-keyup icon indicating copy to clipboard operation
streamlit-keyup copied to clipboard

Add option to mimic a text area

Open pierrelouisbescond opened this issue 1 year ago • 4 comments

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 :-)

pierrelouisbescond avatar Sep 28 '23 07:09 pierrelouisbescond

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.

blackary avatar Sep 29 '23 19:09 blackary

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

ilyesTouz avatar Oct 03 '23 06:10 ilyesTouz

Would be a useful feature for sure for chat projects 👍

AlexandreVerept avatar Oct 03 '23 07:10 AlexandreVerept

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

ATelders avatar Oct 03 '23 11:10 ATelders