gambitph / Stackable

Page Builder Blocks for WordPress. An Amazing Block Library for the new WordPress Block Editor (Gutenberg).
https://wpstackable.com
GNU General Public License v3.0
328 stars 62 forks source link

If Stackable blocks are inside synced patterns and duplicated, blocks has the same id which makes settings apply to both original and duplicated block #2822

Open andeng1106 opened 1 year ago

andeng1106 commented 1 year ago

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. Add a new page
  2. Add any Stackable block (e.g. Heading)
  3. Set the Stackable block as a synced pattern (Options > Create pattern/reusable block > set as "Synced")
  4. Inside the reusable block, duplicate the Stackable block
  5. In the duplicated block, change any setting (color, layout, icon, etc.)
  6. See that the settings are also applied on the original block

Optional steps to see same id for both blocks:

  1. Save page and go to frontend
  2. Right click block and inspect
  3. See that both blocks has the same id

Expected behavior When duplicating Stackable block inside a reusable block and changed settings for the duplicated block, it should not:

Screenshots

https://github.com/gambitph/Stackable/assets/103395655/b1dccb5e-d5ae-4534-9c12-9342739ed779

https://github.com/gambitph/Stackable/assets/103395655/ec118260-30c5-4cb3-a774-0f0efeb74fd3

andeng1106 commented 12 months ago

Update 10/27/23 - Fixed in frontend, remaining issue on editor

https://github.com/gambitph/Stackable/assets/103395655/349031b8-c348-436d-93d7-5d42471384d8