tomusborne / generateblocks

GenerateBlocks is a small collection of lightweight WordPress blocks that can accomplish nearly anything.
https://generateblocks.com
198 stars 23 forks source link

widgets.php - Edit Global Class silently fails #1464

Open iansvo opened 2 weeks ago

iansvo commented 2 weeks ago

Description

If you add a global style to a block that is in a widget area (i.e. widgets.php) and then attempt to edit it, the snackbar notice shows but the sidebar doesn't update to show you to EditClass panel.

Steps to reproduce

  1. Go to Appearance->Widgets
  2. Add a GB block to a widget area
  3. Add a global style to the block
  4. Attempt to edit that style

Expected behavior

Sidebar should show the standard EditClass component with global style controls.

Actual behavior

Snackbar notice says "editing X..." (where X is the classname) but nothing happens in the sidebar.

tomusborne commented 2 weeks ago

Global Styles (and our local styles) currently don't support the widget area.

You can see how we get settings here: https://github.com/tomusborne/generateblocks-pro/blob/release/1.8.0/src/global-classes/hooks/useGetSettings.js

We should likely not show the UI/show a message instead until we're able to support it.