Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button Block: Only display buttons if the title attribute exists #17221

Closed
richtabor opened this issue Aug 27, 2019 · 3 comments · Fixed by #29717
Closed

Button Block: Only display buttons if the title attribute exists #17221

richtabor opened this issue Aug 27, 2019 · 3 comments · Fixed by #29717
Assignees
Labels
[Block] Buttons Affects the Buttons Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@richtabor
Copy link
Member

Describe the bug
Currently, a Button block without a title attribute still renders an empty button via the save function, leaving an empty <a> on the page.

To reproduce
Steps to reproduce the behavior:

  1. Add an empty Button block
  2. Publish the page
  3. View the published page
  4. See error

Expected behavior
A button is not rendered unless the title attribute is entered, preventing empty buttons from displaying if it's not intentionally configured within the editor.

Screenshots
If applicable, add screenshots to help explain your problem.
ScreenFlow

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Safari
  • Version: 12.1.1

Additional context
Using Gutenberg 6.3, although it happens regardless of whether or not the plugin is active.

@richtabor richtabor added the [Block] Buttons Affects the Buttons Block label Aug 27, 2019
@bobbingwide
Copy link
Contributor

Problem still occurs when you add a new button to the buttons block with Gutenberg 7.2.0

@dgaik-gg
Copy link

dgaik-gg commented Aug 2, 2021

What for example with arrow buttons where the arrow is added using a class and text is not necessary? Currently adding a space allows this button to be rendered but this is not a good way.

@getsource
Copy link
Member

Hi @dgaik-gg!

Thanks much for the note about this!
Would you mind opening a new issue, to open discussion about the best way to address this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
4 participants