Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Toast is hidden under drawer / modal #4898

Open
oferitz-apex opened this issue Feb 21, 2025 · 3 comments · May be fixed by #4919
Open

[BUG] - Toast is hidden under drawer / modal #4898

oferitz-apex opened this issue Feb 21, 2025 · 3 comments · May be fixed by #4919
Assignees
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working

Comments

@oferitz-apex
Copy link

HeroUI Version

2.7.2

Describe the bug

Toast notifications cannot be used with Drawer components since the drawer mask and drawer itself are always rendered above the toast messages. I've tried applying a larger z-index, but this doesn't solve the issue - the drawer still overlays the toast.

code to reproduce:

    <ToastProvider
        placement="bottom-left"
        toastOffset={30}
        toastProps={{
          shouldShowTimeoutProgess: true,
          radius: 'lg',
          classNames: {
            base: 'z-[1000]'
          }
        }}
      />



import {
  Button,
  Drawer,
  DrawerBody,
  DrawerContent,
  addToast,
  useDisclosure
} from '@heroui/react'

export default function SandboxPage() {
  const { isOpen, onOpen, onOpenChange } = useDisclosure()
  return (
    <div className="p-8">
      <Drawer isOpen={isOpen} onOpenChange={onOpenChange}>
        <DrawerContent>
          <DrawerBody className="flex flex-col justify-center items-center">
            <Button
              onPress={() =>
                addToast({
                  title: 'Hello World',
                  description: 'This is a toast message',
                  color: 'success'
                })
              }
            >
              Add Toast
            </Button>
          </DrawerBody>
        </DrawerContent>
      </Drawer>
      <Button onPress={onOpen}>Open Drawer</Button>
    </div>
  )
}

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Click on Open drawer
  2. Click on Add toast

Expected behavior

The Toast should be always visible and on top of any other component

Screenshots or Videos

Image

Operating System Version

macOS

Browser

Chrome

Copy link

linear bot commented Feb 21, 2025

@dimitrov9
Copy link

This is true when invoking the toast from a modal as well.

@wingkwong wingkwong changed the title [BUG] - Toast is hidden under drawer [BUG] - Toast is hidden under drawer / modal Feb 22, 2025
@wingkwong wingkwong added 🐛 Type: Bug Something isn't working 📦 Scope : Components Related to the components labels Feb 22, 2025
@GVALFER
Copy link

GVALFER commented Feb 23, 2025

Yes, bug here as well.
if any modal is open, the toast is hidden behind the modal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working
Projects
None yet
5 participants