From 05d6520b22f8c60bff8894080b5c727270474f73 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 27 Nov 2023 08:37:20 +0100 Subject: [PATCH] Fix input switch accessibility --- .../my-account-notification-preferences.component.html | 2 ++ .../my-account-notification-preferences.component.ts | 8 ++++++++ .../my-account-settings/my-account-settings.component.ts | 2 +- .../recommendations/recommended-videos.component.html | 6 +++++- .../app/shared/shared-forms/input-switch.component.html | 6 ++++-- .../app/shared/shared-forms/input-switch.component.scss | 3 ++- .../src/app/shared/shared-forms/input-switch.component.ts | 1 + 7 files changed, 23 insertions(+), 5 deletions(-) diff --git a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.html b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.html index 2af9d576a..aef5c64ca 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.html +++ b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.html @@ -12,6 +12,7 @@
AUTOPLAY - +
diff --git a/client/src/app/shared/shared-forms/input-switch.component.html b/client/src/app/shared/shared-forms/input-switch.component.html index 996655e4a..ad400a82f 100644 --- a/client/src/app/shared/shared-forms/input-switch.component.html +++ b/client/src/app/shared/shared-forms/input-switch.component.html @@ -1,2 +1,4 @@ - - +
+ + +
diff --git a/client/src/app/shared/shared-forms/input-switch.component.scss b/client/src/app/shared/shared-forms/input-switch.component.scss index 0814bd8c2..40457b53e 100644 --- a/client/src/app/shared/shared-forms/input-switch.component.scss +++ b/client/src/app/shared/shared-forms/input-switch.component.scss @@ -3,7 +3,8 @@ input { position: absolute; - top: -100px; + width: 0; + height: 0; left: -100px; + label { diff --git a/client/src/app/shared/shared-forms/input-switch.component.ts b/client/src/app/shared/shared-forms/input-switch.component.ts index e019029c5..a4036ba58 100644 --- a/client/src/app/shared/shared-forms/input-switch.component.ts +++ b/client/src/app/shared/shared-forms/input-switch.component.ts @@ -17,6 +17,7 @@ export class InputSwitchComponent implements ControlValueAccessor { @Input() checked = false @Input() inputName: string @Input() preventUpdate = false + @Input() label = $localize`Toggle` propagateChange = (_: any) => { /* empty */ }