Fix checkbox description relationship

pull/6449/head
Chocobozzz 2024-06-11 10:50:20 +02:00
parent a5513f5415
commit ad396ec891
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 6 additions and 3 deletions

View File

@ -7,8 +7,9 @@
(ngModelChange)="onModelChange()"
[id]="inputName"
[disabled]="disabled"
[attr.aria-describedby]="inputName + '-description'"
/>
<span role="checkbox" [attr.aria-checked]="checked" [attr.aria-label]="labelText || labelInnerHTML"></span>
<span></span>
<span *ngIf="labelText">{{ labelText }}</span>
<span
*ngIf="!labelText && labelInnerHTML"
@ -34,7 +35,7 @@
</div>
<div class="ms-4 d-flex flex-column">
<div class="wrapper form-group-description">
<div class="wrapper form-group-description" [id]="inputName + '-description'">
<ng-content select="description"></ng-content>
</div>

View File

@ -27,6 +27,8 @@ export class PeertubeCheckboxComponent implements ControlValueAccessor, AfterCon
@Input() disabled = false
@Input() recommended = false
describedby: string
@ContentChildren(PeerTubeTemplateDirective) templates: QueryList<PeerTubeTemplateDirective<'label' | 'help'>>
labelTemplate: TemplateRef<any>

View File

@ -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)