Giter Site home page Giter Site logo

Comments (3)

masbaehr avatar masbaehr commented on June 5, 2024 1

This is unfortunately very annoying to the point which makes me want to change notification library. Note: I'm not ranting or "demanding" a fix but i'd really also like to see a solution for it in future, so i think closing the issue is wrong.

Especially if the Notification occur while the Tab is not in the foreground, they stack up and wait for the Tab to be active again, causing a tsunami of notifications which did not pass.

Maybe a quick solution would be to add a configuration flag to completely omit any notification which happens in the background and leave it to the developer to show missed notifications

from react-notifications-component.

teodosii avatar teodosii commented on June 5, 2024

Right, that's because animations are paused when tab is inactive (or sort of paused). Maybe I'll change it in the future to calculate elapsed time from last active tab time, but for now no such thing.

from react-notifications-component.

pauliusg avatar pauliusg commented on June 5, 2024

@masbaehr I use this workaround:

if (document.visibilityState !== 'hidden') {
  Store.addNotification({
    ...notification,
    dismiss: {
      duration: 3000
    }
  })
}

Downside of this, is that, if for example tab was hidden for 1000ms, notification does not show up at all. With proper solution it would show up 3000 - 1000 = 2000ms (duration - hidden tab time).

from react-notifications-component.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.