Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tinymce in bootstrap modal: wrong dropdown position on scroll

I'm using tinymce inside a bootstrap modal but I'm having a problem with tinymce dropdowns on page scroll: basically their absolute positions are not updated and they are shown in the wrong position. I prepared a jsbin to show the problem: just open the color picker and scroll the page.

Any hints? Anyone had the same issue and managed to make it work?

Thanks

like image 305
Dario Avatar asked Aug 05 '16 12:08

Dario


2 Answers

In addition to user206056 css answer:

.mce-menu {position:fixed !important}

try adding to your TinyMCE init method, adding the ui_container parameter and set it to the selector of your bootstrap modal.

Something like:

 tinymce.init({
    selector: '.my-mce-selector',
    ui_container: '.modal', // bootstrap modal
    // your other options ... 
});

Although, this doesn't work in all cases (like inline: true), you may want to follow the GitHub issue for updates.

like image 157
mfink Avatar answered Sep 29 '22 10:09

mfink


Just stumbled upon the same problem. Solved this by adding

.mce-menu {position:fixed !important}

to my css file holding page styles. Hope this helps

like image 35
user2061056 Avatar answered Sep 29 '22 08:09

user2061056