tomusborne / generateblocks

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

Bug: Button element stays the same in editor when link added/removed #1248

Open frzsombor opened 2 weeks ago

frzsombor commented 2 weeks ago

Description

Button element (SPAN/A) stays the same in editor when link added/removed

Steps to reproduce

  1. Create a button in block editor
  2. Block is created as a SPAN elem by default
  3. Add a link to the button

or

  1. Open block editor
  2. Edit a button that has a link (A tag)
  3. Remove the link from the button

Actual behavior

The actual dom elem of the button stays the same, even if we add/remove a link. After saving and reloading (the block editor or the live page) the element changes (from SPAN to A or vice versa), but not "live" in the editor, which makes it confusing when we know we have classes targeting buttons specifically with A or SPAN tags.

Expected behavior

Upon adding/removing a link on a button, it should immediatelly shange to the corresponding dom elem in the block editor, so we see the correct styling.

Additional info

When switching the "Button Type" in advanced (between Link and