open-formulieren / open-forms

Smart and dynamic forms
https://open-forms.readthedocs.io
Other
36 stars 26 forks source link

Content: Style tag in html resets components #3788

Open LaurensBurger opened 10 months ago

LaurensBurger commented 10 months ago

Product versie / Product version

any

Omschrijf het probleem / Describe the bug

Form builders copy and paste content into the "content" component and when this content is styled this style is copied into the wysiwyg editor. This is problamatic for 2 reasons:

  1. The form builder has no idea this is happening, it can only be seen when dark-mode is enabled, like this text that has a style > color > #000 image

  2. These html elements with style get a "nonce" which gets update on each check_logic which in turn causes all components to reset which is most noticeable with:

    • Errors
    • Dropdowns
    • Repeating groups
    • Datepickers

which for no obvious reason keep resetting/closing.

Stappen om te reproduceren / Steps to reproduce

demo form on dev environment "/style"

joeribekker commented 9 months ago

Refinement: Sergei mentions he wants a JSON-format content. Markdown can contain HTML so it just as bad as pure HTML stored in the db. Up for debate on how to handle WYSIWYG-editors. Since this is not reported by end users, we'll keep this on the backlog.

It's hard to do WYSIWGY right...