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

[Rich text] Empty label still shows button #1615

Closed
andrewetchen opened this issue Apr 12, 2022 · 0 comments · Fixed by #1635
Closed

[Rich text] Empty label still shows button #1615

andrewetchen opened this issue Apr 12, 2022 · 0 comments · Fixed by #1635
Assignees
Labels
Category: Bug Something isn't working

Comments

@andrewetchen
Copy link
Contributor

andrewetchen commented Apr 12, 2022

Describe the current behavior

When you add a button block and remove the label, an empty button appears.

Describe the expected behavior

No button when button label is empty. The Image with text section has a button block and a check to not show the button when the label is empty.

Version information (Dawn, browsers and operating systems)

  • Dawn Version: 4.0.0
  • Chrome Version 100.0.4896.75
  • macOS Version 12.3.1

Possible solution

I'll need to add the following condition for the rich text button block:

{%- if block.settings.button_label != blank -%}
  <a{% if block.settings.button_link == blank %} role="link" aria-disabled="true"{% else %} href="{{ block.settings.button_link }}"{% endif %} class="button{% if block.settings.button_style_secondary %} button--secondary{% else %} button--primary{% endif %}" {{ block.shopify_attributes }}>
    {{ block.settings.button_label | escape }}
  </a>
{%- endif -%}

Additional context/screenshots

Rich text - empty button label

image


Image with text - empty button label

image


Related: #1460

@andrewetchen andrewetchen self-assigned this Apr 12, 2022
@andrewetchen andrewetchen added the Category: Bug Something isn't working label Apr 12, 2022
This was referenced Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant