Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make st.toast appear/bring it to the front (stack order) when used in st.dialog #10383

@Socvest

Description

@Socvest

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

Not sure to place this as a feature request or bug but it seems when using st.toast inside st.dialog, the dialog is sent to the background of the dialog.

Reproducible Code Example

import streamlit as st

st.dialog(title="Streamlit Toast Notification")
def toast_notification():
   activate_toast = st.button(label="send toast")
   if activate_toast:
      st.toast("Hi, I am in the background!")

toast_notification()

Steps To Reproduce

  1. Create dialog
  2. Click button to show toast

Expected Behavior

st.toast should be stacked at the front of the dialog.

Current Behavior

Stacks behind st.dialog.

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.42.0
  • Python version: 3.10
  • Operating System: Windows
  • Browser: Chrome

Additional Information

No response

Metadata

Metadata

Assignees

Labels

feature:st.dialogRelated to `st.dialog`feature:st.toastRelated to `st.toast` elementtype:enhancementRequests for feature enhancements or new features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions