Froala editor not working with fancybox plugin

198 Views Asked by At

all the things working correctly but when I add froala in fancybox popup then space, arrowkeys not working also when I click f key then act as full screen please give me solution:

<textarea class="form-control froala-editor" id="comment"></textarea>

js:

$(function(){
    $('.froala-editor').froalaEditor();//{'placeholder': 'Enter some text...'})

        setTimeout(function(){
            $('.froala-editor').froalaEditor('events.focus', true);
                console.clear()
                console.log('fired focus trigger!')
        }, 2000)


        $('.froala-editor').on('froalaEditor.focus', function (e, editor) {
            console.log('received focus trigger')
    });

}); 
2

There are 2 best solutions below

1
On

you can try to use in IFRAME like below

or try use another one lik tinyMCE or CKEditor... Modal recreates textbox so you need to rebind editor may be your current issue.

i wish tihs answer helps

<script type="text/javascript">
        jQuery(function($) {
            $('.open-fancy-box').on('click', function(e) {
                e.preventDefault();

                $.fancybox.open({
                    type: 'iframe',
                    src: 'youreditor.html'
                });
            });
        });
    </script>
2
On

The question is completely wrong - fancybox works fine with anything. In your case, you simply have to tell fancybox not to listen to keyboard events, and most likely you will want to disable touch events, too:

keyboard: false, touch : false