question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<ToastNotification /> prop timeout > 0 does not render component on UI.

See original GitHub issue

BUG -

  1. I am on @carbon/ibm-security version 1.41.0 and
  2. I am facing issue with <ToastNotification /> component.

Description -

  • When I pass prop timeout value > 0 (say 12000), it is not rendering the component on UI.
  • BUT when I pass prop timeout as 0, then it is rendered as expected on UI.
<ToastNotification
    onCloseButtonClick={onToastClose}
    className='toast-notification animated slideInUp'
    title={error.title}
    subtitle={error.subtitle}
    kind={error.title.toLowerCase()}
    caption=''
    timeout={12000}
/>

Expected behavior -

  • Notification should be rendered on UI for provided timeout span

Actual behavior -

  • Notification is not rendered at all if timeout prop value is > 0

Steps for reproducing - (TRY it in both Chrome and Firefox)

Browsers

  • Not browser specific

Optional information

  • None

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
palak1459commented, Jun 17, 2021

@emyarod @SwapnilAhire https://codesandbox.io/s/hopeful-aryabhata-h824j?file=/src/index.js is the reduced test case. It’s not working for “carbon/ibm-security”: “1.40.0” and later. Also found out that this issue is already resolved in https://github.com/carbon-design-system/carbon/issues/8348 and may be available in next version.

0reactions
emyarodcommented, Jul 20, 2021

the fix was released in carbon-components-react@7.33.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Toast Notification: timeout prop · Issue #4666 - GitHub
Leveraging the same idea of a toast timeout, I am conditionally rendering the notification. This way the click handler will not be executed....
Read more >
How to create a custom toast component with React
Learn how to create a customizable toast component that is capable of displaying multiple notifications using the React hooks useState and ...
Read more >
Toast is not rendered (react-toastify component) - Stack Overflow
If I debug it, I see that my toasts are queued, _EventManager2 never gets the _constant.ACTION.MOUNTED event that normally emits the toasts from ......
Read more >
Snackbar / Toast Notifications in React Tutorial - YouTube
In this video I will teach you all how to code a snackbar in reactjs.
Read more >
Creating Toast API with React Hooks | by Aibol Kussain
Additionally, in order to not mess with z-index, it is better to render components like toasts somewhere up in a DOM tree.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found