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

Opening a modal window twice makes it impossible to close it again. #24117

Closed
bjornstenfeldt opened this issue Sep 26, 2017 · 6 comments
Closed

Comments

@bjornstenfeldt
Copy link

Opening a modal window twice makes it impossible to close it again.

So if you open the modal window #modal and then execute $("#modal").modal("show"); in the browser console, it is no longer possible to close the modal window.

I'm using Bootstrap 4.0.0-beta on Chrome 60.0.3112.113.

@Johann-S
Copy link
Member

Bug reports must include a live demo of the problem. Per our contributing guidelines, please create a reduced test case via JS Bin or CodePen and report back with your link, Bootstrap version, and specific browser and OS details.

@bjornstenfeldt
Copy link
Author

https://jsbin.com/comugudafu/edit?html,output

I'm using Bootstrap 4.0.0-beta on Chrome 60.0.3112.113 and Windows 10.

@Joyrex
Copy link

Joyrex commented Sep 29, 2017

I'm a bit confused by this: What would be the use case where you would open a modal from itself? Are you expecting the DOM to clone the modal and create another instance? Bootstrap has long had a rule against multiple modals, so I am not sure if this is really an issue.

@XhmikosR
Copy link
Member

XhmikosR commented Oct 4, 2017

I don't see the use case here either.

@bjornstenfeldt: can you elaborate?

@ghost ghost mentioned this issue Oct 4, 2017
@bjornstenfeldt
Copy link
Author

bjornstenfeldt commented Oct 4, 2017

I don't want to open 2 modals. But I "extended" the modal so I could open it with a hash change event. I did that because I think it is more user-friendly on mobile devices, when you can close a modal by clicking back. At the same time I needed it to open in a callback from a LinkedIn API call, so I ended up having 2 completely separated .modal('open') calls.

@XhmikosR
Copy link
Member

XhmikosR commented Oct 4, 2017

OK, sounds like a fair use case. We have #24240 open, it lacks a unit test though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants