Fix feed inputs accessibility

This commit is contained in:
Chocobozzz 2024-09-19 15:29:22 +02:00
parent cdd874683f
commit e1935acdbf
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
4 changed files with 6 additions and 5 deletions

View File

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

View File

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

View File

@ -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 }"

View File

@ -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 = ''