DEV: Don't add 0-width char if there's no icon in d-button (#26880)
Previously, if you supplied your own content to DButton it would still add the character: ```hbs <DButton>my text</DButton> ``` ```html <button>​ my text</button> ```
This commit is contained in:
parent
378faf060d
commit
d8b1c3c807
|
@ -178,15 +178,13 @@ export default class DButton extends GlimmerComponentWithDeprecatedParentView {
|
|||
>
|
||||
{{#if @isLoading}}
|
||||
{{~icon "spinner" class="loading-icon"~}}
|
||||
{{else}}
|
||||
{{#if @icon}}
|
||||
{{#if @ariaHidden}}
|
||||
<span aria-hidden="true">
|
||||
{{~icon @icon~}}
|
||||
</span>
|
||||
{{else}}
|
||||
{{else if @icon}}
|
||||
{{#if @ariaHidden}}
|
||||
<span aria-hidden="true">
|
||||
{{~icon @icon~}}
|
||||
{{/if}}
|
||||
</span>
|
||||
{{else}}
|
||||
{{~icon @icon~}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
|
@ -197,7 +195,7 @@ export default class DButton extends GlimmerComponentWithDeprecatedParentView {
|
|||
…
|
||||
{{~/if~}}
|
||||
</span>
|
||||
{{~else~}}
|
||||
{{~else if (or @icon @isLoading)~}}
|
||||
​
|
||||
{{! Zero-width space character, so icon-only button height = regular button height }}
|
||||
{{~/if~}}
|
||||
|
|
Loading…
Reference in New Issue