Comments (3)
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.
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.
@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)
- How to give width to notification in percentage HOT 2
- Project breaking due to "Removed default export" HOT 1
- TypeError: Cannot read properties of undefined (reading 'addNotification') HOT 2
- Does not display any notifications
- Scrolling when screen is full of notifications HOT 2
- Please fix typo HOT 1
- Unable to resolve dependency tree error when installing npm packages HOT 4
- Fade In animation suddenly appears instead of playing the animation HOT 3
- uncompatibility with animate.css library HOT 6
- Notifications created in rapid succession may not be removed from the DOM when dismissed HOT 4
- Not all styles are renamed HOT 1
- npm ERR! Missing script: "build:library:dev" HOT 3
- compatibility issue
- The component's test for closing by timeout failed HOT 1
- Store.addNotification is getting called and failing in my tests HOT 4
- 'message' property renders only string, not component HOT 1
- Notification blinks when it appears HOT 2
- Add `top: 0` to rnc__base
- Desktop Notifications as an option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-notifications-component.