-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Implement option to pause when document is hidden #304
Implement option to pause when document is hidden #304
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
This is great! Could you perhaps clarify for the users what a hidden document is in the docs? |
β¦ss; improve documentation with examples
# Conflicts: # website/src/pages/toaster.mdx
Sure thing, just updated it with examples that come from MDN. |
@emilkowalski wdyt of this option being enabled by default? It would change the default behavior, but it also seems slightly more bug fix than feature in some sense, because I think most people would prefer for toasts to not silently appear+disappear when in the background. Up to you though! |
Great call, let's make it the default. |
I'll merge for now as i want to release a new version, we can make it the default in the next PR. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sonner](https://sonner.emilkowal.ski/) ([source](https://github.com/emilkowalski/sonner)) | [`1.3.1` -> `1.4.0`](https://renovatebot.com/diffs/npm/sonner/1.3.1/1.4.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/sonner/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/sonner/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/sonner/1.3.1/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/sonner/1.3.1/1.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>emilkowalski/sonner (sonner)</summary> ### [`v1.4.0`](https://github.com/emilkowalski/sonner/releases/tag/v1.4.0) [Compare Source](https://github.com/emilkowalski/sonner/compare/c449e2741368b04b4524859aa2a60696c0cfb58c...v1.4.0) #### What's Changed - Use bunchee as bundler by [@​huozhi](https://github.com/huozhi) in [https://github.com/emilkowalski/sonner/pull/276](https://github.com/emilkowalski/sonner/pull/276) - build: bump bundler for perf purpose by [@​huozhi](https://github.com/huozhi) in [https://github.com/emilkowalski/sonner/pull/277](https://github.com/emilkowalski/sonner/pull/277) - Fix light theme on homepage by [@​emilkowalski](https://github.com/emilkowalski) in [https://github.com/emilkowalski/sonner/pull/281](https://github.com/emilkowalski/sonner/pull/281) - feat: `description` support function in promise by [@​kahosan](https://github.com/kahosan) in [https://github.com/emilkowalski/sonner/pull/279](https://github.com/emilkowalski/sonner/pull/279) - add PR and issue templates by [@​choeqq](https://github.com/choeqq) in [https://github.com/emilkowalski/sonner/pull/286](https://github.com/emilkowalski/sonner/pull/286) - refactor: remove unused remaining time ref by [@​wobsoriano](https://github.com/wobsoriano) in [https://github.com/emilkowalski/sonner/pull/284](https://github.com/emilkowalski/sonner/pull/284) - types: change label types to ReactNode by [@​CanRau](https://github.com/CanRau) in [https://github.com/emilkowalski/sonner/pull/280](https://github.com/emilkowalski/sonner/pull/280) - feat: add `icons` prop to `<Toaster />` by [@​amirhhashemi](https://github.com/amirhhashemi) in [https://github.com/emilkowalski/sonner/pull/270](https://github.com/emilkowalski/sonner/pull/270) - Fix types of toaster icons by [@​emilkowalski](https://github.com/emilkowalski) in [https://github.com/emilkowalski/sonner/pull/294](https://github.com/emilkowalski/sonner/pull/294) - Fix loading icon bug by [@​emilkowalski](https://github.com/emilkowalski) in [https://github.com/emilkowalski/sonner/pull/295](https://github.com/emilkowalski/sonner/pull/295) - Add close button prop to toast by [@​emilkowalski](https://github.com/emilkowalski) in [https://github.com/emilkowalski/sonner/pull/296](https://github.com/emilkowalski/sonner/pull/296) - Swap bundlers by [@​emilkowalski](https://github.com/emilkowalski) in [https://github.com/emilkowalski/sonner/pull/297](https://github.com/emilkowalski/sonner/pull/297) - Dont dismiss loading toast by [@​emilkowalski](https://github.com/emilkowalski) in [https://github.com/emilkowalski/sonner/pull/298](https://github.com/emilkowalski/sonner/pull/298) - Upgrade bunchee for bundling bug fixes by [@​huozhi](https://github.com/huozhi) in [https://github.com/emilkowalski/sonner/pull/299](https://github.com/emilkowalski/sonner/pull/299) - bump packages by [@​choeqq](https://github.com/choeqq) in [https://github.com/emilkowalski/sonner/pull/283](https://github.com/emilkowalski/sonner/pull/283) - chore: remove unused npm lock file by [@​huozhi](https://github.com/huozhi) in [https://github.com/emilkowalski/sonner/pull/300](https://github.com/emilkowalski/sonner/pull/300) - fix: make closeButton option in toast take precedence over Toaster by [@​jzxhuang](https://github.com/jzxhuang) in [https://github.com/emilkowalski/sonner/pull/309](https://github.com/emilkowalski/sonner/pull/309) - Renaming too general className with project-specific one ([#​305](https://github.com/emilkowalski/sonner/issues/305)) by [@​jschoder](https://github.com/jschoder) in [https://github.com/emilkowalski/sonner/pull/315](https://github.com/emilkowalski/sonner/pull/315) - ghost-div doesn't block click in Firefox by [@​jschoder](https://github.com/jschoder) in [https://github.com/emilkowalski/sonner/pull/307](https://github.com/emilkowalski/sonner/pull/307) - Avoid issues with `<li>` offest when using different positions by [@​mmalomo](https://github.com/mmalomo) in [https://github.com/emilkowalski/sonner/pull/314](https://github.com/emilkowalski/sonner/pull/314) - Implement option to pause when document is hidden by [@​etcd](https://github.com/etcd) in [https://github.com/emilkowalski/sonner/pull/304](https://github.com/emilkowalski/sonner/pull/304) - Update bundler by [@​emilkowalski](https://github.com/emilkowalski) in [https://github.com/emilkowalski/sonner/pull/317](https://github.com/emilkowalski/sonner/pull/317) #### New Contributors - [@​kahosan](https://github.com/kahosan) made their first contribution in [https://github.com/emilkowalski/sonner/pull/279](https://github.com/emilkowalski/sonner/pull/279) - [@​choeqq](https://github.com/choeqq) made their first contribution in [https://github.com/emilkowalski/sonner/pull/286](https://github.com/emilkowalski/sonner/pull/286) - [@​CanRau](https://github.com/CanRau) made their first contribution in [https://github.com/emilkowalski/sonner/pull/280](https://github.com/emilkowalski/sonner/pull/280) - [@​amirhhashemi](https://github.com/amirhhashemi) made their first contribution in [https://github.com/emilkowalski/sonner/pull/270](https://github.com/emilkowalski/sonner/pull/270) - [@​jzxhuang](https://github.com/jzxhuang) made their first contribution in [https://github.com/emilkowalski/sonner/pull/309](https://github.com/emilkowalski/sonner/pull/309) - [@​jschoder](https://github.com/jschoder) made their first contribution in [https://github.com/emilkowalski/sonner/pull/315](https://github.com/emilkowalski/sonner/pull/315) - [@​mmalomo](https://github.com/mmalomo) made their first contribution in [https://github.com/emilkowalski/sonner/pull/314](https://github.com/emilkowalski/sonner/pull/314) - [@​etcd](https://github.com/etcd) made their first contribution in [https://github.com/emilkowalski/sonner/pull/304](https://github.com/emilkowalski/sonner/pull/304) **Full Changelog**: emilkowalski/sonner@v1.3.0...v1.4.0 </details> --- ### Configuration π **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). π¦ **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. π **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/SHABIN-K/toss). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNTMuMiIsInVwZGF0ZWRJblZlciI6IjM3LjE1My4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=-->
Issue π±:
Closes #303
What has been done β :
useIsDocumentHidden
hookpauseWhenDocumentHidden
prop toToast
andToaster
Toast
timers when document is hiddenToaster
Screenshots/Videos π₯:
N/A