Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TinyMCE menu dropdowns in modal edit forms are displaced depending on PageScroll #867

Open
fredvd opened this issue Sep 14, 2018 · 1 comment · Fixed by #920
Open

TinyMCE menu dropdowns in modal edit forms are displaced depending on PageScroll #867

fredvd opened this issue Sep 14, 2018 · 1 comment · Fixed by #920

Comments

@fredvd
Copy link
Sponsor Member

fredvd commented Sep 14, 2018

I've just submitted this issue in plone.app.mosaic's tracker as I found it first there, but it might be a more general problem with pat-modal and pat-tinymce and not specific for mosaic.

The editor drop down menu's of a tinymce instance get displaced in a modal on a mosaic editor page when the page is scrolled down. Tested with coredev 5.1.4-dev0

plone/plone.app.mosaic#425

edit_modal_page_scroll_bottom_4

@fredvd
Copy link
Sponsor Member Author

fredvd commented Feb 26, 2020

This issue is not entirely fixed by the commit in #867 .

@cillianderoiste @thet The fix probably works when you have only 1 tinymce pattern active on the page, but when there are multiple tinymce's like on a mosaic page as with plone/plone.app.mosaic#425

The menu items in a tinymce placed in a modal now completely disappear instead of just being displaced.

I've got an easy fix: generate a random string id and append it to the id passed as a ui_container for every instantiated tinymce-pattern. This fixes the issue locally for me in plone.app.mosaic, where the mosiac editor screen already has some (hidden) tinymce's and a tile popup contains three more tinyme fields.

        if (modal_container.length > 0) {
            var random_id = Math.random().toString(36).substring(2, 15) ;
            modal_container.attr("id", "tiny-ui-container-" + random_id);
            tinyOptions['ui_container'] = "#tiny-ui-container-" + random_id;
        }

        tinymce.init(tinyOptions);
        self.tiny = tinymce.get(self.tinyId);```

I'll create another pull request. 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant