-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
TextEditorField loses h3 heading configured with documented blockAttributes #5725
Comments
Facing the same issue. Any updates? |
Same Issue. I need a good editor that can i use for my blog. |
I have the same issue. After digging in EA persistence process, I figured out that the correct value is saved in database. However, when re-editing the content, this is here the custom tag is lost. Once the form is rendered, we can see in HTML:
I guess it's because the configuration of Trix made by EA is done too late. It should listen on Beside, we should find a way to easily allow the addition of custom tools to the sidebar (like h2, h3, etc). https://github.com/basecamp/trix/tree/1.3.1#observing-editor-changes |
This PR was merged into the 4.x branch. Discussion ---------- fix(trix): fix trix editor config loading Ref #5725 This PR change the listen event to boot TextEditorField. Before it listen on `DOMLoadedContent`. Now it listen on `trix-before-initialize` to be sure to handle the custom configuration and render properly a `heading1` element with a custom tagName `h2` for example. If needed, I can add some tests to cover it. Commits ------- 1f49189 fix(trix): fix trix editor config loading
Fixed in #5928. Thanks a lot for reporting this error and for fully investigating its cause. |
Describe the bug
I wanted to implement the
blockAttributes
config as documented at https://symfony.com/bundles/EasyAdminBundle/current/fields/TextEditorField.html#settrixeditorconfigWhen I did so, I was able to create a heading in the Trix editor in EasyAdmin, and when viewing the saved field the heading was a correct
h3
and thediv
tags were correctly replaced byp
tags.However, when I edited my entity again, Trix completely lost the heading tag and didn't show it in the editor. Re-saving the entity without making any changes incorrectly removed the headings.
To Reproduce
EasyAdmin version is
4.6
. To reproduce, install EasyAdmin. In an entity CRUD controller, in theconfigureFields()
function, define a field as follows:Then edit your entity using that CRUD controller, set a heading within the field, save the entity, then edit it again - and notice that Trix has lost the heading.
Screenshots
First edit:
View result (correct):
Edit entity again (Trix loses the
h3
heading):Save entity without making changes -
h3
is lost:The text was updated successfully, but these errors were encountered: