Used attribute itemsJustification
is not declared in block's schema
#34003
Labels
[Block] Social
Affects the Social Block - used to display Social Media accounts
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Is there an existing issue for this?
Have you tried deactivating all plugins except Gutenberg?
Have you tried replicating the bug using a default theme e.g. Twenty Twenty?
Description
In #28980 items justification was added to
Social Links
block. This PR though while started using a new attribute(itemsJustification
) it was never declared in the block's schema(block.json
).Step-by-step reproduction instructions
Social Links
block and change the justification from the control.Also check the blocks
block.json
file.Expected Behavior
The attribute should be declared and a migration would be needed based on existing classes.
I would propose though to hold onto this a bit before fixing, as in this PR: #33987 there is exploration of using a
flex
layout for this block. If this PR lands we would need to remove the now missing attribute, so this issue will be resolved.Current Behavior
What this means in practice is that the attribute is never saved. When we insert such a block the value is
undefined
so the default behavior felt okay (left align/flex-start). While editing this value by the corresponding control we were setting the value withsetAttributes
, which doesn't sanitize the attributes, and added a css class which was was then saved. On reload though, the same block seemed to be keeping its behavior by the css classname and not the attribute - the attribute isundefined
. So if you change this value after reload a new css class will be applied that leads to multiple conflicting classes - there is only one winner though with unexpected results 😄 .The text was updated successfully, but these errors were encountered: