Skip to content

Commit 0b34f44

Browse files
committed
redo
1 parent 1f2a237 commit 0b34f44

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

goldens/material/slide-toggle/index.api.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export class MatSlideToggle implements OnDestroy, AfterContentInit, OnChanges, C
5050
_getAriaLabelledBy(): string | null;
5151
_handleClick(): void;
5252
hideIcon: boolean;
53-
hideLabel: boolean;
5453
id: string;
5554
get inputId(): string;
5655
_labelId: string;
@@ -67,8 +66,6 @@ export class MatSlideToggle implements OnDestroy, AfterContentInit, OnChanges, C
6766
// (undocumented)
6867
static ngAcceptInputType_hideIcon: unknown;
6968
// (undocumented)
70-
static ngAcceptInputType_hideLabel: unknown;
71-
// (undocumented)
7269
static ngAcceptInputType_required: unknown;
7370
// (undocumented)
7471
static ngAcceptInputType_tabIndex: unknown;
@@ -91,7 +88,7 @@ export class MatSlideToggle implements OnDestroy, AfterContentInit, OnChanges, C
9188
validate(control: AbstractControl<boolean>): ValidationErrors | null;
9289
writeValue(value: any): void;
9390
// (undocumented)
94-
static ɵcmp: i0.ɵɵComponentDeclaration<MatSlideToggle, "mat-slide-toggle", ["matSlideToggle"], { "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; }; "required": { "alias": "required"; "required": false; }; "color": { "alias": "color"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "hideIcon": { "alias": "hideIcon"; "required": false; }; "hideLabel": { "alias": "hideLabel"; "required": false; }; "disabledInteractive": { "alias": "disabledInteractive"; "required": false; }; }, { "change": "change"; "toggleChange": "toggleChange"; }, never, ["*"], true, never>;
91+
static ɵcmp: i0.ɵɵComponentDeclaration<MatSlideToggle, "mat-slide-toggle", ["matSlideToggle"], { "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "labelPosition": { "alias": "labelPosition"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; }; "required": { "alias": "required"; "required": false; }; "color": { "alias": "color"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "hideIcon": { "alias": "hideIcon"; "required": false; }; "disabledInteractive": { "alias": "disabledInteractive"; "required": false; }; }, { "change": "change"; "toggleChange": "toggleChange"; }, never, ["*"], true, never>;
9592
// (undocumented)
9693
static ɵfac: i0.ɵɵFactoryDeclaration<MatSlideToggle, never>;
9794
}

src/material/slide-toggle/slide-toggle.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@
5353
</span>
5454
</button>
5555

56-
<!--
57-
Clicking on the label will trigger another click event from the button.
58-
Stop propagation here so other listeners further up in the DOM don't execute twice.
59-
-->
60-
<label class="mdc-label" [for]="buttonId" [attr.id]="_labelId" (click)="$event.stopPropagation()">
61-
<ng-content></ng-content>
62-
</label>
56+
<!--
57+
Clicking on the label will trigger another click event from the button.
58+
Stop propagation here so other listeners further up in the DOM don't execute twice.
59+
-->
60+
<label class="mdc-label" [for]="buttonId" [attr.id]="_labelId" (click)="$event.stopPropagation()">
61+
<ng-content></ng-content>
62+
</label>
6363
</div>

src/material/slide-toggle/slide-toggle.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ $fallbacks: m3-slide-toggle.get-tokens();
3333
}
3434
}
3535

36+
// Ensure no label element (with a click handler) present to ensure hidden from screen readers.
3637
label:empty {
37-
// display: none;
38+
display: none;
3839
}
3940

4041
.mdc-switch__track {

src/material/slide-toggle/slide-toggle.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ export class MatSlideToggle
186186
/** Whether to hide the icon inside of the slide toggle. */
187187
@Input({transform: booleanAttribute}) hideIcon: boolean;
188188

189-
/** Whether to hide label for the slide toggle. */
190-
@Input({transform: booleanAttribute}) hideLabel: boolean;
191-
192189
/** Whether the slide toggle should remain interactive when it is disabled. */
193190
@Input({transform: booleanAttribute}) disabledInteractive: boolean;
194191

0 commit comments

Comments
 (0)