Avijeet Ghosh
Avijeet Ghosh

Reputation: 167

Bootstrap Modal closing when any modal inside is closed

I am using basic bootstrap modal inside which there is a summernote text area.
Problem is when I click on the insert picture button in summernote, it again opens a modal to choose the picture, but if I click on the modal close button of the summernote picture modal without choosing the picture, it closes the main modal too.
I don't want to close the main modal when modal close of the picture modal is clicked. Any help would be appreciated....

Upvotes: 0

Views: 1051

Answers (2)

Made in Moon
Made in Moon

Reputation: 2464

@argon 's solution didn't work for me.

But I found this solution (provided here):

('#HtmlContent').summernote( {
  dialogsInBody: true,
});

Upvotes: 0

user4244405
user4244405

Reputation:

  • Check that these modals do not share the same id attribute
  • Also check that they do not share the same name attribute
  • you can give them separate names manually (like numbers: modal1)
  • you can also name them automatically with your server-side language when creating them, or with JavaScript upon load, but remember to reference these names correctly in the references, buttons & functions that close them.

Upvotes: 2

Related Questions