tomusborne / generatepress

451 stars 89 forks source link

Buttons element stays the same in editor when link added/removed #617

Closed frzsombor closed 5 months ago

frzsombor commented 5 months 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.

frzsombor commented 5 months ago

I'm sorry, this supposed to go to GenerateBlocks, closing this now in favor of: https://github.com/tomusborne/generateblocks/issues/1248