IfnotFr / PopConfirm

A simple action confirmation plugin for jQuery based on Twitter Bootstrap Popover

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open popovers do not close when another PopConfirm popover is triggered

bhall7 opened this issue · comments

Thanks for the great work on this plugin!

One thing I noticed is that if you have multiple rows of items in a list, each with their own button which triggers .popConfirm(), then triggering more than one PopConfirm popover does not close any other open popovers. This could result in a confusing user experience if multiple buttons were clicked:
multiple_popconfirm_popovers
The ideal behavior would be to only allow one PopConfirm popover open at a time (or make it an option to only show one PopConfirm popover at a time).

Thanks!

Hi,

Yep you're right, i noticed the problem before, i will check and resolve this issue when i have the time :)

Thanks for your feedback !

This is fixed for any triggers/buttons of the same class; however, I noticed that if there are two triggers of two different classes, then it is still possible to open two PopConfirm popovers simultaneously, which could create user confusion:

duelingpopconfirms

Can you guive me a example page / code for reproduce this bug ? Thanks :)

I tried to put an example together on both Bootply and JSFiddle, but it wouldn't allow it (403 forbidden error). But, if you look at the example, you will be able to reproduce the above issue where if PopConfirm is called from a different class, multiple instances can be triggered simultaneously, causing confusion.

Do you mean that you have several popConfirm js instantiations ?

Like that :

$(".class1").popConfirm();
$(".class2").popConfirm();

And the problem still persist across two classes ?

Yes. That is correct. There may be two different buttons that both trigger a popConfirm, but have different options and questions, etc. Here's what I think would make the most sense:

User clicks on $(".class1").popConfirm(); to trigger a popConfirm popover. User then clicks $(".class2").popConfirm(); and $(".class1").popConfirm(); toggles closed. In other words, only one popConfirm popover would be allowed at a time, regardless of the class from which it was called.

Ok i will see for that too, maybe #3 will fix this problem in a more elegant way :)

The lastest fix did not fix this problem, if someone has an idea, I'm interested :)

PS : I updated test pages for showing your case.

Here's an example of multiple PopConfirm popovers being open (called from different classes): http://jsfiddle.net/bhall7x/Y4t8a/6/

Problem fixed with #10 when merge ok :)