From ad396ec891dd5d466ca9259807cc65b9c0813c5e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Jun 2024 10:50:20 +0200 Subject: [PATCH] Fix checkbox description relationship --- .../app/shared/shared-forms/peertube-checkbox.component.html | 5 +++-- .../app/shared/shared-forms/peertube-checkbox.component.ts | 2 ++ .../shared-user-settings/user-video-settings.component.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client/src/app/shared/shared-forms/peertube-checkbox.component.html b/client/src/app/shared/shared-forms/peertube-checkbox.component.html index cd06e75ba..1ea52896e 100644 --- a/client/src/app/shared/shared-forms/peertube-checkbox.component.html +++ b/client/src/app/shared/shared-forms/peertube-checkbox.component.html @@ -7,8 +7,9 @@ (ngModelChange)="onModelChange()" [id]="inputName" [disabled]="disabled" + [attr.aria-describedby]="inputName + '-description'" /> - + {{ labelText }}
-
+
diff --git a/client/src/app/shared/shared-forms/peertube-checkbox.component.ts b/client/src/app/shared/shared-forms/peertube-checkbox.component.ts index db5f1d83f..6c78afa84 100644 --- a/client/src/app/shared/shared-forms/peertube-checkbox.component.ts +++ b/client/src/app/shared/shared-forms/peertube-checkbox.component.ts @@ -27,6 +27,8 @@ export class PeertubeCheckboxComponent implements ControlValueAccessor, AfterCon @Input() disabled = false @Input() recommended = false + describedby: string + @ContentChildren(PeerTubeTemplateDirective) templates: QueryList> labelTemplate: TemplateRef diff --git a/client/src/app/shared/shared-user-settings/user-video-settings.component.ts b/client/src/app/shared/shared-user-settings/user-video-settings.component.ts index bf474ecec..ad2dddf59 100644 --- a/client/src/app/shared/shared-user-settings/user-video-settings.component.ts +++ b/client/src/app/shared/shared-user-settings/user-video-settings.component.ts @@ -136,7 +136,7 @@ export class UserVideoSettingsComponent extends FormReactive implements OnInit, next: () => { this.authService.refreshUserInformation() - if (this.notifyOnUpdate) this.notifier.success($localize`Video settings updated.`) + if (this.notifyOnUpdate) this.notifier.success($localize`Video settings updated.`, 'toto', 15000) }, error: err => this.notifier.error(err.message)