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

hallo toolbar misplacement within StreamField in a MultiFieldPanel #3587

Closed
loleg opened this issue May 9, 2017 · 3 comments
Closed

hallo toolbar misplacement within StreamField in a MultiFieldPanel #3587

loleg opened this issue May 9, 2017 · 3 comments
Labels
component:Rich text status:Won't Fix The issue is outside the Wagtail scope type:Bug

Comments

@loleg
Copy link

loleg commented May 9, 2017

Issue Summary

The toolbar overlaps content in the text editor when a RichTextBlock is used inside of a MultiFieldPanel.

The workaround is to wrap the RichTextBlock in a StructBlock - as per #1511 fixed in #3415 - or not to use MultiFieldPanel.

Steps to Reproduce

Set up a model as follows:

body_de = StreamField([('paragraph', RichTextBlock())])
content_panels = [
        MultiFieldPanel([
            StreamFieldPanel('body')
        ])
]

Observe the toolbar overlapping like this:

screenshot from 2017-05-09 12-29-33

Technical details

  • Python version: 3.5.3
  • Django version: 1.11
  • Wagtail version: 1.10
  • Browser version: tested in current stable versions of IE, Firefox, Chrome
@strindhaug
Copy link
Contributor

strindhaug commented May 16, 2017

It seems to me that this fancy positioned toolbar is way to complex to be bugfree, and every fix for one position issue seems to cause other position issues in other contexts.

Would it be possible modify the toolbar so that it's not positioned, but inserted statically just above the text-area, instead? (Or if having multiple toolbars instead of one positioned one breaks the script, just reserve plenty of space above each rich-text texareas so that the toolbar is always outside the textarea)

@samuelantonioli
Copy link

samuelantonioli commented Aug 4, 2017

Had the same problem and solved it using a hacky workaround. I'm sure that the toolbar will make some problems if we integrate the css rule I've added here in other edge cases.

I'm not suggesting you should use the following, but it solves the problem (using a not maintainable way, I admit).
Maybe we can build a proper solution based on it:

In some_app/wagtail_hooks.py:

from django.contrib.staticfiles.templatetags.staticfiles import static
from django.utils.html import format_html

from wagtail.wagtailcore import hooks

@hooks.register('insert_editor_css')
def editor_css():
    return format_html(
        '<style>{}</style>',
        'body div.hallotoolbar:not(.stream-field) {min-width: 850px !important;transform: translate3d(-60px, -75px, 0px) !important;}'
    )

@thibaudcolas
Copy link
Member

We've replaced Hallo with a new editor, which doesn't have as fancy toolbar positioning, so doesn't have this issue. Closing.

@thibaudcolas thibaudcolas mentioned this issue Jan 26, 2018
4 tasks
@thibaudcolas thibaudcolas added the status:Won't Fix The issue is outside the Wagtail scope label Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:Rich text status:Won't Fix The issue is outside the Wagtail scope type:Bug
Projects
None yet
Development

No branches or pull requests

5 participants