question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wysihtml5 brokes modal

See original GitHub issue

If i use wysihtml5 in modal, when i open modal with form that use wyshtml5 it works fine. But when i close modal, and then open it second time , and run .wysihtml5 on text_area in my form, then are 3 modal-backdrops instead of 1 . (2 of them fade). It’s wysihtml5 bug, or i`m doing something bad?

Issue Analytics

  • State:open
  • Created 11 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
goodbombcommented, Nov 10, 2013

Figured it out. You have to remove the iFrame and toolbar whenever the modal is hidden and re-show the textarea so that on each subsequent modal display, the wysithml5 function starts all over again. This is what I did:

$(document).ready(function(){
    $('#modal').on('shown', function(){
        $('#textarea').wysihtml5();
    });

    $('#modal').on('hidden', function(){
        $('.wysihtml5-sandbox, .wysihtml5-toolbar').remove();
        $('#textarea').show();
    });
});

This issue can probably be closed now.

0reactions
goodbombcommented, Nov 8, 2013

Did anyone figure out a solution for this? I’m having this problem right now as well. I’m only calling the wysihtml5 once on modal show, but every subsequent modal that’s displayed doesn’t load properly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wysihtml5 brokes modal - Stack Overflow
Yes, there is a bug. When you use wysihtml5 in modal, you should initialize it on modal shown and you should remove it...
Read more >
WYSIHTML in Bootstrap Modal (IE) - CodePen
Debug issue loading WYSIHTML editor inside of a Bootstrap modal.... ... <button class="btn btn-default" data-wysihtml5-command="bold"><i class="fa ...
Read more >
bootstrap-wysihtml5-rails 0.3.3.4 → 0.3.3.5 - Diffend
+ return k+='<li>\n <div class="bootstrap-wysihtml5-insert-image-modal ... node]";if(I&&w(a))return"[Broken node]";if(k(a))return'"'+a.data+'"';if(1==a.
Read more >
[Best solution]-bootstrap wysihtml5 is not working in IE9
How do you fit background/imgs properly with css/html? How to render form in Bootstrap modal in Rails? Ruby on Rails -- Heroku: Issue...
Read more >
Wysiwyg | Drupal.org
The Wysiwyg module supports any kind of client-side editor including HTML editors (a.k.a. WYSIWYG), pseudo-editors (buttons to insert markup ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found