notiflix / Notiflix

Notiflix is a pure JavaScript library for client-side non-blocking notifications, popup boxes, loading indicators, and more that makes your web projects much better.
https://notiflix.github.io
MIT License
647 stars 55 forks source link

SOLVED: Blocking confirm #3

Closed sinankeskin closed 5 years ago

sinankeskin commented 5 years ago

Hi. First of all thank you for this great library.

Your library emphasize non-blocking nature strongly. Which is a good thing in most cases but confirm function is a little bit different.

Here is the scenario: User changes the form but doesn't save and clicks another link in the screen. In this scenario, we should warn the user and he/she confirm the action. After that, if the user confirms, we should rollback all changes and redirect or we should prevent the redirection.

This scenario doesn't apply to your library by nature of non-blocking confirm function but native javascript confirm function is blocking the main thread and runs smootly.

How about add an option to change the default behavior? And also, I think confirm function optionally can return a boolean value which like, true user clicked ok, false user clicked cancel.

Thanks.

furcan commented 5 years ago

Hi,

Thanks for your feedback.

Unfortunately, your first request is not possible in libraries such as Notiflix.

I will add a Callback option for "No" button like as "Yes" button in next version. (The other request.)

Thanks.

furcan commented 5 years ago

Hi again.

Notiflix v1.7.0 released yet and added another optional callback for Deny Button in the Confirm module.

Thanks.

https://github.com/notiflix/Notiflix/blob/master/ReleaseNotes.md