Skip to content

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

Fix input switch accessibility

Chocobozzze2c7e58f42b3
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 2def02a057..996655e4a2 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,2 @@
-<input type="checkbox" [checked]="checked" [name]="inputName" [id]="inputName" (change)="update()" [disabled]="preventUpdate" />
+<input type="checkbox" role="switch" [checked]="checked" [name]="inputName" [id]="inputName" (change)="update()" [disabled]="preventUpdate" />
<label [for]="inputName" class="ms-auto">Toggle</label>
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 8ee8a371db..0814bd8c25 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;
- visibility: hidden;
+ top: -100px;
+ left: -100px;
+ label {
cursor: pointer;
@@ -41,4 +42,8 @@ input {
transform: translateX(-100%);
}
}
+
+ &:focus-visible + label {
+ outline: 2px solid;
+ }
}