Skip to content

NO-ISSUE: Fix warning: A control must be associated with a text label.#157

Open
fantonangeli wants to merge 2 commits into
serverlessworkflow:mainfrom
fantonangeli:no-issue-fix-file-upload-aria-label-DiagramEditorDragNDrop
Open

NO-ISSUE: Fix warning: A control must be associated with a text label.#157
fantonangeli wants to merge 2 commits into
serverlessworkflow:mainfrom
fantonangeli:no-issue-fix-file-upload-aria-label-DiagramEditorDragNDrop

Conversation

@fantonangeli
Copy link
Copy Markdown
Member

This fixes the warning:

> oxlint --config .oxlintrc.json src/ stories/ tests/


  ⚠ jsx-a11y(control-has-associated-label): A control must be associated with a text label.
     ╭─[stories/DiagramEditorDragNDrop.tsx:102:9]
 101 │             </div>
 102 │ ╭─▶         <input
 103 │ │             id="file-upload"
 104 │ │             className="dec:hidden"
 105 │ │             type="file"
 106 │ │             accept=".yaml,.yml,.json"
 107 │ │             onChange={handleFileChange}
 108 │ │             data-testid="story-workflow-file-upload"
 109 │ ╰─▶         />
 110 │           </div>
     ╰────
  help: Add a text label to the control element. This can be done by adding text content, an `aria-label` attribute, or an `aria-labelledby` attribute.

Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com>
Copilot AI review requested due to automatic review settings May 22, 2026 10:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Improves accessibility of the Diagram Editor drag-and-drop story by explicitly associating the hidden file input with its visible label for assistive technologies.

Changes:

  • Adds an id to the <label> element used as the visible “browse” control.
  • Adds aria-labelledby on the <input type="file"> to reference that label.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/serverless-workflow-diagram-editor/stories/DiagramEditorDragNDrop.tsx Outdated
Comment thread packages/serverless-workflow-diagram-editor/stories/DiagramEditorDragNDrop.tsx Outdated
Signed-off-by: fantonangeli <fabrizio.antonangeli@gmail.com>
Copy link
Copy Markdown
Contributor

@kumaradityaraj kumaradityaraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

3 participants