-
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
RichText not passing value to render callback #11465
Comments
I'm rolling my eyes, but a workaround is adding an extra attribute, call it const onRichChange = ( key, bugfix, val ) => {
props.setAttributes( { [key] : val, [bugfix] : val } );
}
...
onChange: val => {
onRichChange( 'rich', 'richValue', val );
} This fits in perfectly with the rest of my code, I must admit. Ok, off to my therapist. |
One more note. What I wrote as a work-around does not work, it doesn't seem, unless you make two calls to setAttributes:
Maybe there's a clue there? |
You should remove "source" and "selector" from your I'm closing now, let me know if it fixes your issue. |
I have a couple of
RichText
fields in my block, and a few other controls of misc types (noneRichText
) in my inspector. Simplified, this is how they're configured:If I type "Howdy" into
rich
and make a selection insimple
, my console reflects every keystroke properly, eventually ending up with:And when auto-saving or when clicking "save":
So the "rich" property is being updated and seemingly should be able to be saved...are certainly passed as attribute to the callback rendering function, eh?
But examining
wp_posts
, here's what's inpost_content
:In our callback, doing a
var_dump( func_get_args() )
:It does not matter if I format
RichText
or not.The text was updated successfully, but these errors were encountered: