Comments (7)
Closed in #63. Credits to @bharatramnani94.
from notyf.
Hey!
Thanks for bringing this to my attention. There's currently no way to programmatically close the Notyf. I'll work on this feature and add it on v3.x.
from notyf.
v3.0.0 has been released with a lot of cool things. I left this for 3.1.0 as I didn't really got time to add this feature, but it's on the roadmap for sure.
from notyf.
Close option would be good, is it coming anytime soon? a button to dismiss would also be good.
from notyf.
Hey @caroso1222
Currently, the success
, error
and open
methods do not return anything.
Maybe they can return the notification
(of type NotyfNotification
), which can be passed to a new dismiss(notificationToDismiss: NotyfNotification)
method to achieve this functionality.
Let me know what you think. Maybe I can take this issue.
from notyf.
Hey @bharatramnani94. Yeah, I like that. Thanks for bringing it up again.
I'm still not sure whether to go functional on this one like a method dismiss(notification)
on the global instance or OOP-style in the notification instance myNotyf.dismiss()
.
I'm inclined towards the former as I don't think a notification should be able to call itself dismissed, only the master should. (Just thinking out loud)
I think, then, a good solution would be something like:
const notyf = new Notyf();
const foobar = notyf.success('baz');
setTimeout(() => notyf.dismiss(foobar), 5000);
I'm totally fine if you want to take it, thanks!
Right off the bat, I think renaming _removeNotification
to dismiss
and making it public would make the trick, but will need testing. It might be a breaking change in case someone is using that private, undocumented method so maybe for backward compatibility purpose we'd just keep it and write a new proxy method dismiss
.
from notyf.
Closed in #63. Credits to @bharatramnani94.
Honestly, all credit goes to you @caroso1222. You did the heavy work for it. I'm just glad that this got done.
from notyf.
Related Issues (20)
- [ Feature Request ] Use vscode remote containers
- Allow custom css to be injected HOT 1
- Using long text
- Link to the documentation flag as insecure HOT 1
- [Feature Request] Config option for a custom node to attach toast notifications HOT 2
- How to make a notification appear only once HOT 2
- Website SSL certificate expired HOT 2
- I don't know how to properly set the position value on vue? HOT 1
- Will this work inside of a shadow DOM? HOT 1
- How to make the notification called only once. And he didn't write it into the document every time he called.
- Is there a way to set position per call ? HOT 1
- esc key
- I want to change the z-index.
- Different position moves existing notifications
- All of my styling dosent work (vuejs(composition api) ,tailwindcss)
- Icons don't display on warn, info type
- Long text creates curve?
- Uncaught (in promise) TypeError: notyf is undefined HOT 1
- Pause timer when the window loses focus
- Add "style" attribute to package.json
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 notyf.