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
- How to change a user’s password programatically
- Create a table in custom plugin on the activating it?
- How would you require and automatically download dependent plugins?
- How to delete custom taxonomy terms in plugin’s uninstall.php?
- Redirect to settings page after install
- What is the correct way for a theme to support plugin UIs?
- How does WordPress determine the primary plugin PHP file?
- translation does not work with text_domain
- Publish Post After Click On A Link
- Custom url structure for custom template
- flush_rewrite_rules() not working on plugin activation
- Having separate plugins and themes folder for multi-site setup
- gallery option is not available in media upload box in costum theme option page
- Many plugins making WordPress run slow by design?
- How can plugins have their own pages?
- Reusable functions and tools (Framework)
- Add keywords meta to index.php page
- How to create ‘import dummy data’ option in custom wordpress plugin
- Object Oriented Plugin not working
- What are the specifics of WordPress development I need to know? [closed]
- Insert data from .sql file in wordpress plugin
- How can i get the post’s full html source by its ID?
- Force file download on plugin activation
- How to change the name of the “edit my profile” link in the WordPress admin backend
- WordPress Jquery UI Spinner
- execute function after one completed
- How can I run a custom shortcode function on a live site and only run if the viewer is a specific machine?
- How to Resize the Custom Post Images?
- React error #231with Custom Blocks after upgrade to WP 5.5
- Upload files to the plugin menu
- Class or function wrapper for plugin code
- Licensing a Plugin [closed]
- Add a function call after content automatically?
- WordPress plugin with its own “site”/theme
- Ajax request sends url rather than data
- How can I disable an attribute from a Gutenberg block included in a template via InnerBlocks?
- Security of a WordPress Plugin
- Grouping imported products and showing variations based on selected product
- @wordpress/scripts advanced usage
- How to display the category name in the tab and post inside the tab in WordPress?
- Shortcode do not return the right data in post
- Ultimate Members Default Post Layout problem
- best way to upload a large file to wordpress using wp all import
- Gutenberg Block: How to reload a ServerSideRender?
- Performance considerations – postmeta table versus new table for custom posts with foreign keys?
- How to define the slug for my custom plugin?
- Avoid WordPress header bar when form submission using admin_post in the frontend
- Set “Open in New tab” as default option
- Generate and send ICS file through WordPress
- Gutenberg editor in WordPress 5.0.3 /wp-json/wp/v2/pages/4713/autosaves?_locale=user 500 (Internal Server Error)
- Field salespeople task management
- Is it possible to create duplicate post on other site (either push, on publish, or pull, periodically)?
- Hide ‘add to cart’ button for some products [duplicate]
- Add Flatr button to Sharing option
- Change localization only for plugin
- How to get author developer link on plugin page
- wp_schedule_event need to deactivate plugin changing recurrance
- A more elegant way to handle notices/warnings
- Redirect default login page to a custom page [duplicate]
- appointment plugin doesn’t display all appointments
- Display_rows() and column_cb() strange behaviour
- Doing action based on input from options menu
- Create New Admin Menu Section – Like how custom post type works, in a way
- Customize Multi-Column Tag Map to fetch specific post-type
- Combining JS files to one script
- What are the downsides of using bootstrap in plugin development?
- How to generate a responsive output from plugin?
- The plugin generated xxx characters of unexpected output during activation
- Upload Image to desired directory through plugin
- Meta box not displaying on the plugin page
- public custom posts not showing in my wordpress plugin