Before breaking down my problem into a reproducible example (complex). I wanted to throw this issue out there:
I now have an st.fragment
(frag-2) nested inside of another st.fragment
(frag-1).
FRAG-2 rewrites to a column withing FRAG-1.
Functionality works as expected but only if I do the following:
@st.fragment()
def func():
container = st.empty()
print(container)
# write to the container including `form` stuff
# `container` stuff changes based on `form` submission callback
container.write("text to page")
** if I don’t print(container)
statement in there, I have a “ghost” submit button that gets written to the container
. And if I submit the form multiple times, I’ll accumulate “ghost” buttons (which are not clickable).
I’ve tried other alternatives to print(container)
to “flush” the container clear-- including different variations of emptying the container before an after the callback–but to no repeatable success.
I was wonder if anyone knew of this edge case before I tried to receate basic example.
PRE-RELEASE edit:
May be related. I will test this scenario, too: St.experimental_fragment issue with dynamically created containers
(The workaround in the link above works also)
container_rows_empty.empty()
time.sleep(.01)