Can some one help me?
Hello
Thank you so much! :) I'll give that a try
in cases where I use the blocks only in a localized richText field, I can just omit the localized field and everything will work as expected?
Exactly! Omit it from any field & sub-field
And the localisation will still work as the base richText field is localized, right?
Yep! If any parent is localized, in this case the richText field, the localization property of sub fields will not have any effect anyways (outside of this lexical bug where it breaks)
Thank you for your answer,
@360823574644129795!
This means in cases where I use the blocks only in a localized richText field, I can just omit the localized field and everything will work as expected? And the localisation will still work as the base richText field is localized, right?
you will have to remove
localized: true
from any block fields / sub fields within lexical blocks. Having that property set will make them vanish from the API response.
This was a bug and has been fixed in the latest 3.0 beta version (
https://github.com/payloadcms/payload/pull/6489). If those same blocks/fields are shared & used in other places within payload, and you cannot remove localized: true, I recommend making a utility function which automatically strips
localized: true
from those fields
could you take a look at this one when you have a minute?
I have an issue with a custom block type in the lexical editor. The block type contains richText fields that are just not present in the result returned from the API. Concretely, I have a cards module that has three rich text fields. Other fields of the card however are present in the response. Please look at the attached images of the post and the API response.
If you need the code, I already threw away a lot of what we had in the repo so that it is very close to a minimal sample. We have payload version 2.13.0 and
@967091941873426493/richtext-lexical version 0.10.0 in our package.json.
Star
Discord
online
Get dedicated engineering support directly from the Payload team.