mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #20963] [CLOSED] fix: prevent duplicate labels on password input (a11y) #41483
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20963
Author: @huangkevin-apr
Created: 1/27/2026
Status: ❌ Closed
Base:
dev← Head:my-feature📝 Commits (1)
d335a10Fix a11y bug📊 Changes
1 file changed (+0 additions, -1 deletions)
View changed files
📝
src/lib/components/common/SensitiveInput.svelte(+0 -1)📄 Description
Description
This PR fixes an accessibility issue where a password input field was associated with multiple labels, violating WCAG (1.3.1).
The issue was identified using IBM Accessibility Checker and resolved using A11YRepair by removing a redundant screen-reader-only label rendered by
SensitiveInput.sveltewhen an external visible label is already present.This is a small, non-breaking accessibility bug fix.
Issue Details
Reproduce Steps
This accessibility issue was identified while starting the Open WebUI frontend development server using:
On the login page, an accessibility checker reported a
form_label_uniqueviolation, indicating that a form control is associated with more than one<label>element.Specifically, the password input field was linked to both a visible label and an additional
screen-reader-only(sr-only) label, resulting in multiple labels referencing the same form control.Accessibility Impact
This behavior violates WCAG Success Criterion 1.3.1 (Info and Relationships), which requires that form controls have clear and unambiguous programmatic labels.
Resolving this issue ensures that the password field has a single, clear accessible name, improving the login experience for screen reader users without changing any visual behavior.
Soluation Details
The A11Y Bug Report indicates a
form_label_uniqueviolation, stating "Form control has more than one label" for the password input field. Thesnippetprovided in the report,<label for=\"password\" class=\"sr-only\">, points to a screen-reader-only label as one of the culprits.Bug Scenario and Root Cause:
The webpage screenshot and the DOM inspection reveal that the password input field has two associated labels:
<label for=\"password\" class=\"text-sm font-medium text-left mb-1 block\">Password</label><label class=\"sr-only\" for=\"password\">Enter Your Password</label>The root cause is that the
SensitiveInput.sveltecomponent, which is used for the password input, unconditionally renders ansr-onlylabel. When this component is used in a context where a separate, visible label is already provided (as seen in the screenshot), it results in two labels being associated with the same input field. This redundancy confuses assistive technologies and violates WCAG 1.3.1 (Info and Relationships).Proposed Fix:
Since a visible label "Password" is already present and correctly associated with the input, the
sr-onlylabel generated bySensitiveInput.svelteis redundant and should be removed. Theplaceholderattribute on the input itself can still provide a visual hint within the input field.Testing
form_label_uniqueviolation is resolvedFix Before

1 Violation
Fix After

0 Violation
Additional Info
The patch submitted in this PR was generated by A11YRepair, an automated Web Accessibility repair tool that I developed to address common accessibility violations in web applications. The generated fixes were manually reviewed and validated before submission.
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.