Thank you very much @okld!!! I really needed this component!
Anyway I am running some issues, I enclosed three istances of the component in my app, which is an app I use to let the people i work with create an email based on a template.
But when I edit the fields (before I was using a normal text field to input HTML) the app keeps rerunning and sometimes even loses what I was writing in. I guess this is kind of embedded in streamlit as it reruns, but would it be possible to use this editor without the app constantly rerunning?
I have been calling the component this way:
mainTextBody = st_quill(value = data[‘mainTextBody’], html=True , readonly=False, key=“mainTextBody”)
the value data[‘mainTextBody’] comes from a configuration file, as I needed to have a prefilled value from the previous emails so the user can edit it. But while editing, the app reruns and after a while it restores the initial value, losing the edits.
I have three instances of the component, with different keys.
If you have suggestions on how to avoid this it would be great!
Thanks in advance!
Does it happen to rerun when data['mainTextBody'] changes?
It’d say that for the moment, it’s a little bit risky to rely on Streamlit keeping changes. I’ll try to investigate that issue anyway, hopefully I’ll find what’s causing the erasing of quill’s content.
hi @okld and thanks again to you! Extremely useful for me.
About the rerun, it changes mostly at every digit, and at a certain point after some editing within the quill component, the whole app blanks and the content goes back to what is in the value= field. The app populates the data at the beginning from a .json file , and I use it to populate several st.text_input fields, and select boxes.
Then I have a “confirm” data button at the end, that if pressed, would change the data. if st.button('Confirm Data'): data['mainTextBody'] = mainTextBody
and all the other input fields. and then I write the email, and save the .json with the updated data.
If you have the possibility to have a look at the code let me know best way to do it. Thanks again!
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.