generateblocks
generateblocks copied to clipboard
Advanced backgrounds bug
Description
There is a little bug with the Advanced Backgrounds feature. If you apply any advanced image as background after adding a simple background (with inline style enabled), the simple background overwrites the advanced background on the front end.
Steps to reproduce
- Insert container.
- Set up a simple background image (
Backgrounds > Image URL
). - Toggle
Use inline style
-- important (I use inline style background images for lazy load backgrounds with JavaScript). - Without removing the previously inserted image click on the
Advanced
toggle. - Add two images: a) device: mobile, state: normal, target: self, any URL b) device: desktop, state: normal, target: self, any URL
- Close the Advanced background modal.
- Publish the page.
- Check the source of the generated container.
https://user-images.githubusercontent.com/10430702/207037021-5a59308d-77ac-42ce-ab24-67bc173b9e62.mp4
Expected behavior
The container should have the background image from Advanced Background.
Actual behavior
The container has the firstly added simple image as background.
When you use the Advanced Background
feature, the simple background option disappears from the block editor. It cannot be modified until you disable the Advanced Background again, but the previously set value is still there.
References:
...