This is an anti-pattern. Itās like having a button nested in a button. The st.feedback
widget will only appear immediately after a user submits a chat message. If the user interacts with the feedback widget, the resulting rerun will have if prompt...
evaluated to False
, so there will be no st.feeback
to evaluate.
Thereās a variety of ways to implement it, depending on how you want to save feedback and if you want users to be able to change their mind or vote on older replies. Hereās just one example: