mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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}}
|
{{#if @isLoading}}
|
||||||
{{~icon "spinner" class="loading-icon"~}}
|
{{~icon "spinner" class="loading-icon"~}}
|
||||||
{{else}}
|
{{else if @icon}}
|
||||||
{{#if @icon}}
|
{{#if @ariaHidden}}
|
||||||
{{#if @ariaHidden}}
|
<span aria-hidden="true">
|
||||||
<span aria-hidden="true">
|
|
||||||
{{~icon @icon~}}
|
|
||||||
</span>
|
|
||||||
{{else}}
|
|
||||||
{{~icon @icon~}}
|
{{~icon @icon~}}
|
||||||
{{/if}}
|
</span>
|
||||||
|
{{else}}
|
||||||
|
{{~icon @icon~}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
@ -197,7 +195,7 @@ export default class DButton extends GlimmerComponentWithDeprecatedParentView {
|
|||||||
…
|
…
|
||||||
{{~/if~}}
|
{{~/if~}}
|
||||||
</span>
|
</span>
|
||||||
{{~else~}}
|
{{~else if (or @icon @isLoading)~}}
|
||||||
​
|
​
|
||||||
{{! Zero-width space character, so icon-only button height = regular button height }}
|
{{! Zero-width space character, so icon-only button height = regular button height }}
|
||||||
{{~/if~}}
|
{{~/if~}}
|
||||||
|
Loading…
Reference in New Issue
Block a user