Menu

#70 How do I remove the element?

closed
nobody
None
2016-02-19
2015-05-07
Anonymous
No

Originally created by: lindamarieb

In FAQ "I'm using a Bootstrap Modal and the backdrop doesn't fade away", it mentions: "It will try and make both elements into a modal. This means both elements will get a backdrop. In this case, either remove the extra elements, or find the specific element you need from the provided modal.element property."

I have a scenario where I want to force the user to take an action via a modal dialog. If the user does not take the action and reloads the page, it will open the dialog again with the result that the dialog cannot be closed properly.

How do I find the existing dialog element and remove it?

Discussion

  • Anonymous

    Anonymous - 2015-07-12

    Originally posted by: dwmkerr

    Hi @lindamarieb I'm not sure I understand the question. The issue you refer to at the beginning is about having multiple top level elements in the modal template, i.e.

    <div>One</div>
    <div>Some Modal</div>
    <div>Two</div>
    

    would not be a suitable modal template as it has three top level elements, this is solved by doing:

    <div>
      <div>One</div>
      <div>Some Modal</div>
      <div>Two</div>
    </div>
    

    The DOM bloat of backdrops can occur when you do not allow the animation to bootstrap animation to complete, if it does not complete it will not remove the backdrop.

    Now if there is a modal present and the user reloads the page, why would there be a backdrop present at all? A reload is going to clear the DOM and rebuild it with the contents of the GET.

    Are you looking for [#33]? Please take a look at that issue, if it looks like it is the same issue then please let me know, I'll close this and bump the priority of [#33].

     

    Related

    Tickets: #33

  • Anonymous

    Anonymous - 2016-02-19

    Ticket changed by: dwmkerr

    • status: open --> closed
     

Log in to post a comment.