Skip to content
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

Popups are closing if singleton is set to true #122

Open
Lovro1107 opened this issue Sep 1, 2019 · 2 comments
Open

Popups are closing if singleton is set to true #122

Lovro1107 opened this issue Sep 1, 2019 · 2 comments

Comments

@Lovro1107
Copy link

I am having problems when setting singleton to true. When I click on a button the confirmation popup shows but then immediately closes.

My code:

$('body > .container > section').confirmation({
        rootSelector: 'body > .container > section',
        selector: '[data-toggle=confirmation]',
        singleton: true,
        placement: 'top',
        btnCancelLabel: 'PREKLIČI',
        btnCancelClass: 'btn-default btn-sm',
        btnCancelIcon: 'fa fa-back',
    });

What I was able to figure out was that _setConfirmationListeners() is executed twice when a button is clicked, so the function for managing singletons is also called twice.
The first time the element of the clicked button is passed as this to the function, but the second time the element from the rootSelector is passed as this and then popup is closed.
I didn't dig any deeper than this and don't know if this is will help you in any way (is this expected behaviour?) but I'm just sharing what I know.

I'm using Bootstrap v4.3.1 and jQuery v3.4.1.

@Lovro1107
Copy link
Author

Looks like this project is not maintained anymore. Closing this ticket as "won't fix".

@Lovro1107 Lovro1107 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2024
@mistic100
Copy link
Owner

Even though the project is unmaintained I prefer keeping actual bugs open. It will be easier for a future maintainer, or for me, to know what has to be done.

@mistic100 mistic100 reopened this Oct 17, 2024
Repository owner locked and limited conversation to collaborators Oct 17, 2024
@mistic100 mistic100 reopened this Oct 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants