-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Experiment: Allow editing of custom fields in block bindings #58723
Conversation
Size Change: +74 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
if ( boundAttributes[ attributeName ] ) { | ||
const { | ||
placeholder, | ||
useValue: [ sourceValue = null ] = [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sourceValue
> metaValue
. I'd suggest sourcePropValue
as well.
setAttributes={ ( newAttributes ) => { | ||
registry.batch( () => | ||
updatedSetAttributes( newAttributes ) | ||
); | ||
} } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm right, this scenario will cover the case when the attributes are edited from the BlockEdit function representation. This means that if, for instance, you change the attribute value by dispatching an action, the updatedSetAttribute will never be called.
WIP
I'm creating this pull request to test different approaches to enable the editing of custom field. Bear in mind that this hasn't been even tested.
What?
Experimental code to discuss different approach to be able to edit the value of the custom fields when using block bindings.
Why?
Testing Instructions