Skip to content

fix(react): improve form accessibility and input labeling - #1442

Open
Siddh2024 wants to merge 3 commits into
RocketChat:developfrom
Siddh2024:fix/a11y-form-inputs
Open

Siddh2024 wants to merge 3 commits into
RocketChat:developfrom
Siddh2024:fix/a11y-form-inputs

Conversation

@Siddh2024

@Siddh2024 Siddh2024 commented Nov 18, 2026 •

Copy link
Copy Markdown

fix(react): improve form accessibility and input labeling

Acceptance Criteria fulfillment

  • Added id, name, and descriptive aria-label="Upload file" to the hidden file input in ChatInput.js.
  • Converted field label wrappers in LoginForm.js from <div> tags to semantic <label htmlFor="..."> elements with corresponding id and name attributes.
  • Modernized LoginForm.js keyboard handling by replacing deprecated onKeyPress with onKeyDown.
  • Made password visibility toggle an accessible <Box is="button" ...> with dynamic aria-label.
  • Added name, id, autoComplete="one-time-code", accessible label, and Enter-key submission to TwoFactorTotpModal.js.
  • Added name, id, and descriptive aria-label attributes to inputs in InsertLinkToolBox.js and MessageReportWindow.js.
  • Added Changeset for @embeddedchat/react version tracking.
  • Verified 0 lint errors (yarn lint) and clean production build (yarn build).

Fixes #1441

Video/Screenshots

Before (Browser Audit Warning):

Screenshot 2026-11-18 215642

After (Warning Resolved):

Screenshot 2026-11-18 220546

PR Test Details

Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-1442 after approval. Contributors are requested to replace <pr_number> with the actual PR number.

@CLAassistant

CLAassistant commented Nov 18, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@swarnendusahu10-dotcom

Copy link
Copy Markdown
Contributor

Hey @Siddh2024! 👋 Tested your branch locally, noticed a few issues worth addressing:

  1. Duplicate ID Risk in Embeds: Hardcoding static IDs (id="ec-*") leads to duplicate DOM ID collisions when a host app embeds multiple chat instances, conflicting with WCAG unique ID standards.
  2. Button Styling Artifact: Setting is="button" on the password eye icon introduces default browser button styles (a gray background and border over the input) since the styles don't reset background/border.
  3. Missing preventDefault on Enter: In LoginForm.js, pressing Enter doesn't prevent default key behavior, which can cause event bubbling and trigger accidental form submissions in host applications.
  4. Brittle Label Check: Checking field.label === 'Password' to render the eye icon breaks if labels are modified or translated; checking field.name === 'password' is safer.

@Siddh2024

Copy link
Copy Markdown
Author

@swarnendusahu10-dotcom Thanks for the great feedback and for testing it locally! 🙌

I've addressed all 4 points in the latest commits:

  1. Dynamic unique IDs: Replaced all static id="ec-*" attributes with React's useId() hook across all form views to prevent any DOM collision when embedding multiple chat instances.
  2. Button style reset: Reset background: none; border: none; padding: 0; margin: 0; on passwordEye in LoginForm.styles.js to remove default browser button styling.
  3. preventDefault on Enter: Added event.preventDefault() on Enter keydown in LoginForm.js and TwoFactorTotpModal.js to stop event bubbling into host forms.
  4. Resilient password field check: Updated the check to field.name === 'password' instead of checking field.label.
  5. Merged latest develop: Synced cleanly with upstream develop.

All lint and build checks are passing. Please take another look when you get a chance!

@Siddh2024

Copy link
Copy Markdown
Author

@swarnendusahu10-dotcom , we good to merge ? ... also i have found out that the keyboard navigation is not working appropriately on the simple tab ... (Ready to chat tab) ... there .. I found that clicking down the tab then enter ... opens the login module ,,, rather than the tab navigations working

@Siddh2024

Copy link
Copy Markdown
Author

@Aryan-Verma-999 , hey sir ,,, could you please inspect this PR too .

@swarnendusahu10-dotcom

Copy link
Copy Markdown
Contributor

@Siddh2024 Other maintainers will look into your PR in their respective time , its not polite to pin them every time . They will look into your PR and address accordingly .
Patience is key .
Thank You :)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Missing form accessibility attributes, semantic labels, and deprecated event handlers in React views

3 participants