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 issue with autoclose #4982

Open
wasimakram-mulla opened this issue Mar 5, 2025 · 8 comments
Open

[BUG] - Toast issue with autoclose #4982

wasimakram-mulla opened this issue Mar 5, 2025 · 8 comments
Assignees

Comments

@wasimakram-mulla
Copy link

wasimakram-mulla commented Mar 5, 2025

HeroUI Version

2.7.4

Describe the bug

I am using the toast, and facing with 2 issues

  1. Width is taking full width by default of the entire window, It should either have a prefixed width or I should be able to prefix it.
  2. I tried timeout and without timeout in both the places like addToast and in toastprovider still my toast is not getting close

Used it like this

addToast({
            title: "Toast Title",
            timeout:1000,
          });

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

Tried both the following approaches

  1. Approach 1
        variant="flat"
        onPress={() => {
          addToast({
            title: "Toast Title",
          });
        }}
      >
        Default
      </Button>
  1. Another Approach
  useEffect(() => {
    addToast({
      title: "Toast Title",
      variant: "solid",
      color: "success",
    });
  }, []);

Expected behavior

Should have specific width, some default style, and autoclose as shown in the documentation

Screenshots or Videos

Image

Operating System Version

Windows 11

Browser

Chrome

Copy link

linear bot commented Mar 5, 2025

@macci001
Copy link
Contributor

macci001 commented Mar 5, 2025

Hey, @wasimakram-mulla. Can you please clean-up your caches, node_modules, .next etc and try again once?

@shrimp2t
Copy link

shrimp2t commented Mar 6, 2025

I have same issue

@shrimp2t
Copy link

shrimp2t commented Mar 6, 2025

It's working ok when you use package "@heroui/toast" instead "@heroui/react"

@wingkwong
Copy link
Member

@shrimp2t which version you were using?

@shrimp2t
Copy link

shrimp2t commented Mar 6, 2025

@shrimp2t which version you were using?

I using version 2.7.4

@jatin127
Copy link

jatin127 commented Mar 6, 2025

+1 Same issue with version 2.7.4

@wasimakram-mulla
Copy link
Author

Hey, @wasimakram-mulla. Can you please clean-up your caches, node_modules, .next etc and try again once?

Yeah I tried that and it still works, and as per the comment by @shrimp2t it works when we use @heroui/toast but I don't want to install the lib just for that.
It should be fixed in the core library of @heroui/react

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants