Turns out, you need to manually add the wrapper class in the edit function. Here’s the source – https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/#classname
I changed this line –
<section className={`text-section-one`} style={{ backgroundColor: `${bgColor}`}} >
to
<section className= { `${props.className} text-section-one`} style={{ backgroundColor: `${bgColor}`}} >
and it solved problem.
Related Posts:
- Passing select control value to block
- Passing RichText attributes to function onChange
- How do I store information in a dynamic block in WordPress?
- How to create custom embed block in gutenberg wordpress
- How to use get_theme_mod in gutenberg editor wordpress?
- How to add Internationalization in WordPress using Javascript/React?
- how to disable blockrenderAppender inside all Innerblocks?
- WordPress Gutenberg react make import of __experimentalUseInnerBlocksProps which is no more experimetal
- Using SVN to upload plugin created with gutenberg blocks
- How to add custom table style for table block in gutenberg editor
- Why is the ‘Gutenberg’ Plugin generating an ‘Inconsistent File Permissions’ error when other Plugins, with the same permissions, do not?
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Use a custom block in another block
- Gutenberg default attributes are empty when accessing in edit
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- Has blocks gutenberg block multiples registers type in my Plugin
- Fixed: Console.log twice in the edit function
- How to resolve warning for `unstableOnSplit` prop on a DOM element in block editor
- How to dynamically add template in Innerblock?
- Block content rendering on the top just below body tag
- Gutenberg: Dynamic Block – Show saved data in the editor
- Create plugin with multiple blocks
- How do I set register_meta for a specific CPT?
- How do I save meta key value in the save function?
- Update Content for a Custom Block Toolbar Button
- Wrong block appender button showing
- How to get custom setting from get_option and pass it in getEntityRecords in gutenberg block?
- Vanilla javascript in custom gutenberg block not working
- WordPress custom block: Link saved in database not retrieved when editing post
- Why is my Gutenberg block not saving and rendering the chessboard?
- How can we extent core/group or cover block?
- How to change the version of block.js and plugin to the same of Package.json?
- How do I apply different block supports to different parts of my custom block?
- Custom Gutenberg blocks not showing in WP editor
- Stop a plugin in the activation process when a certain WP version is not met then show error message in admin_notices action hook
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- How to Add an Index to Plugin Database table
- How to safely sanitize a textarea which takes full HTML input
- How to Remove Certain Screen Options and Meta Boxes from add/edit post type?
- Why activate_plugin is not working in register_activation_hook
- Creating two database tables via plugin
- Is it a good idea to edit an already existing plugin to add more functionality?
- Custom Filter in WordPress to modify footer information via plugin?
- Editor access to plugin settings
- How to use a Must-Use plugin to hide a regular one and to hide itself?
- Shortcode display outside the div
- How does wordpress distinguish a plugin’s main php file from other php files? [duplicate]
- Insert code after tag without using functions.php?
- wordpress plugin that show my reputation (points) in any stackexchange project in my wordpress blogs
- Why load_textdomain work but not load_plugin_textdomain?
- Extend the Admin Post/Edit page
- Can wp_script_is used in pluginA check if a script is being enqueued/registered from pluginB?
- Licensing of freemium plugin
- Why was my plugin rejected from the WordPress.org repository?
- $wpdb working with ajax but showing ajax error instead of success
- Default Plugin Settings Not Writing to Database
- how to Include json manifest file in wp plugin
- Create a custom page template inside my wordpress plugin
- White page on custom plugin option submit
- Unable to override pluggable function wp_mail
- Avoid class name collision when using third party libraries in plugins?
- I want to auto populate data in three fields if one drop down is selected
- Plugin development: Buggy plugin preview
- how to use in custom single.php template using php?
- How can I change the meta_key for a particular piece of information?
- Howto check version of another plugin and then add a submenu page to it
- Can’t get Gutenberg InspectorControls to work
- Issues with a WP plugin menu system
- Different custom templates for product category [closed]
- Add a “View all” button on WooCommerce product archives pages
- How do I add an options page at the bottom of the list?
- A question of etiquette when forking a plugin? [closed]
- how to request a script more than once in wordpress
- How to log custom plugin error to debug.log file
- How to make a Product page without ordering and database
- wp_options not returning value for logged out users?
- How to create admin setting for this small plugin
- Hide all Admin Notices and move on a separate page
- How to fix caching issue in PHP data from database
- WordPress Gutenberg How to make TextControl Required?
- Adding shortcodes to multiple pages with function
- SASS not showing in customized preloader plugin
- How to securely controlling data without keeping it in postmeta?
- Get a list of Product Categories inside a loop
- Can you develop themes and plugins while using the hosting services BlueHost? [closed]
- WordPress plugin changes not updating
- wordpress ajax pagination object value does not change
- Google analytic issue in wordpress
- Custom pages with plugin
- What’s the preferred method of writing AJAX-enabled plugins?
- Shortcode registered from a plugin not recognized
- wp_update_post call really slow when official Facebook plugin is installed
- How to set-up multiple cron task with wp_schedule_event so that they do not overlap?
- _e in wordpress +
- WordPress Code Access to Restricted Content without Registration
- Plugin version number after code rewrite [closed]
- How can I make my plugin detect if a certain theme is active?
- Plugin Block at the backend of every page or post
- How to add a react element into the DOM node (only on the user-interaction like on click) without using the state?
- WordPress theme development – the template dropdown in Pages and disappeared