Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
192
rated 0 times [  198] [ 6]  / answers: 1 / hits: 62396  / 12 Years ago, fri, november 30, 2012, 12:00:00

I try to have a modal inside another modal. However, I got an error like too much recursion in firefox.



I used the latest jQuery and Twitter bootstrap but still have this problem.



Here is the plunker that shows the error



You can find errors in console Uncaught RangeError: Maximum call stack size exceeded or too much recursion



Does anyone know how to fix it? Thanks


More From » jquery

 Answers
20

Ok, it seems like an issue that has been discovered.



(apparently I should use key word Uncaught RangeError: Maximum call stack size exceeded instead of too much recursion :( )



Here are the solutions.



1. modify the modal.js



in this post, https://github.com/twbs/bootstrap/pull/5022



@onassar bring up a solution




Follow up: for anyone working with bootstrap-modal v2.2.0, in the
enforceFocus method, commenting out that.$element.focus() seems to fix
the issue.



The result of this is the modal's don't get focused upon (pfft, I can
do that myself :P), and thus, the multiple modals don't challenge
one-another for focus (which resulted in an infinite loop, and a
rangerror/recursive loop).



Hope that helps :)




I tried and it works. (plunker)



2. Use another plugin to address this Demo



It seems like it works pretty well.



3. Wait for official solution.



In their roadmap, they do want to rewrite this modal plugin at some point.


[#81687] Thursday, November 29, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sienad

Total Points: 208
Total Questions: 100
Total Answers: 77

Location: Taiwan
Member since Mon, Sep 6, 2021
3 Years ago
sienad questions
Sat, Jun 19, 21, 00:00, 3 Years ago
Mon, Nov 30, 20, 00:00, 4 Years ago
Thu, Jul 30, 20, 00:00, 4 Years ago
;