Skip to content

Commit c7bcc8f

Browse files
committed
fix(switch): correct icon display logic
1 parent 996889c commit c7bcc8f

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

elements/pf-v6-switch/pf-v6-switch.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@
162162
/** Check icon color. Overrides the `--pf-t--global--icon--color--on-brand--default` design token. */
163163
color: var(--pf-v6-c-switch__toggle-icon--Color,
164164
var(--pf-t--global--icon--color--on-brand--default, light-dark(#ffffff, #1f1f1f)));
165+
166+
&[hidden] {
167+
display: none;
168+
}
169+
165170
}
166171

167172
#label {

elements/pf-v6-switch/pf-v6-switch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class PfV6Switch extends LitElement {
102102
return html`
103103
<span id="toggle" class="${this.#classes}">
104104
<span id="check-icon"
105-
?hidden=${!this.showCheckIcon || !this.checked}>
105+
?hidden=${!this.showCheckIcon || (this.showCheckIcon && !this.checked)}>
106106
<svg role="presentation"
107107
fill="currentColor"
108108
height="1em"

0 commit comments

Comments
 (0)