Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix feed inputs accessibility

Chocobozzze1935acdbf51
diff --git a/client/src/app/+login/login.component.html b/client/src/app/+login/login.component.html
index 23976221af..f31c785f0b 100644
--- a/client/src/app/+login/login.component.html
+++ b/client/src/app/+login/login.component.html
@@ -69,7 +69,7 @@
<label i18n for="password">Password</label>
<my-input-text
- formControlName= "password" inputId="password" i18n-placeholder placeholder="Password"
+ formControlName="password" inputId="password" i18n-placeholder placeholder="Password"
[formError]="formErrors['password']" autocomplete="current-password" [tabindex]="2"
></my-input-text>
</div>
diff --git a/client/src/app/+my-account/my-account-applications/my-account-applications.component.html b/client/src/app/+my-account/my-account-applications/my-account-applications.component.html
index d1dc9bfb6c..3550488819 100644
--- a/client/src/app/+my-account/my-account-applications/my-account-applications.component.html
+++ b/client/src/app/+my-account/my-account-applications/my-account-applications.component.html
@@ -17,12 +17,12 @@
<div class="form-group">
<label i18n for="feed-url">Feed URL</label>
- <my-input-text [value]="feedUrl" [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true"></my-input-text>
+ <my-input-text inputId="feed-url" [value]="feedUrl" [withToggle]="false" [withCopy]="true" [show]="true" [readonly]="true"></my-input-text>
</div>
<div class="form-group">
<label i18n for="feed-token">Feed Token</label>
- <my-input-text [value]="feedToken" [withCopy]="true" [readonly]="true"></my-input-text>
+ <my-input-text inputId="feed-token" [value]="feedToken" [withCopy]="true" [readonly]="true"></my-input-text>
<div class="form-group-description" i18n>⚠️ Never share your feed token with anyone.</div>
</div>
diff --git a/client/src/app/shared/shared-forms/input-text.component.html b/client/src/app/shared/shared-forms/input-text.component.html
index f2a9139e53..4ea382beee 100644
--- a/client/src/app/shared/shared-forms/input-text.component.html
+++ b/client/src/app/shared/shared-forms/input-text.component.html
@@ -1,6 +1,6 @@
<div class="input-group">
<input
- [id]="inputId" [autocomplete]="autocomplete" [value]="value" [placeholder]="placeholder" [tabindex]="tabindex"
+ [id]="inputId" [name]="inputId" [autocomplete]="autocomplete" [value]="value" [placeholder]="placeholder" [tabindex]="tabindex"
[(ngModel)]="value" (ngModelChange)="update()" [readonly]="readonly"
#input (click)="input.select()" (input)="update()" (change)="update()" [type]="inputType" class="form-control"
[ngClass]="{ 'input-error': formError }"
diff --git a/client/src/app/shared/shared-forms/input-text.component.ts b/client/src/app/shared/shared-forms/input-text.component.ts
index ce827a6061..b07708d789 100644
--- a/client/src/app/shared/shared-forms/input-text.component.ts
+++ b/client/src/app/shared/shared-forms/input-text.component.ts
@@ -22,7 +22,8 @@ import { NgClass, NgIf } from '@angular/common'
export class InputTextComponent implements ControlValueAccessor, AfterViewInit {
@ViewChild('input') inputElement: ElementRef
- @Input() inputId = Math.random().toString(11).slice(2, 8) // id cannot be left empty or undefined
+ @Input({ required: true }) inputId: string
+
@Input() value = ''
@Input() autocomplete = 'off'
@Input() placeholder = ''