Skip to content

Commit

Permalink
fix(progress-indicator): label attribute not showing when there is wh…
Browse files Browse the repository at this point in the history
…en there is white space before closing tag (#11430)

…ite space before closing

### Related Ticket(s)

Closes #11167

### Description

The label text of the web component does not show when there are spaces or line breaks before the closing tag.
There is an unnamed slot in the component, which replaces the `<p>` tag with the white space inside the component.

### Changelog

**Changed**

- Named the slot the to `label-text`.

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
  • Loading branch information
sangeethababu9223 authored Jan 22, 2024
1 parent 533176a commit 954ecf4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default class CDSProgressStep extends FocusMixin(LitElement) {
}[state],
children: svgLabel ? svg`<title>${svgLabel}</title>` : undefined,
})}
<slot>
<slot name="label-text">
<p
role="button"
class="${prefix}--progress-label"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
>
<span class="cds--checkbox-label-text">
<slot>
Checkbox label
</slot>
</span>
</label>
Expand All @@ -61,3 +60,4 @@
</div>
```

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class="cds--progress-step-button"
tabindex="0"
>
<slot>
<slot name="label-text">
<p
aria-describedby="label-tooltip"
class="cds--progress-label"
Expand All @@ -34,7 +34,7 @@
class="cds--progress-step-button"
tabindex="0"
>
<slot>
<slot name="label-text">
<p
aria-describedby="label-tooltip"
class="cds--progress-label"
Expand Down

0 comments on commit 954ecf4

Please sign in to comment.