Skip to content

fix(FileUpload): add aria-disabled attribute when disabled#6653

Open
innocenzi wants to merge 2 commits into
nuxt:v4from
innocenzi:fix/file-upload-aria-disabled
Open

fix(FileUpload): add aria-disabled attribute when disabled#6653
innocenzi wants to merge 2 commits into
nuxt:v4from
innocenzi:fix/file-upload-aria-disabled

Conversation

@innocenzi

Copy link
Copy Markdown
Contributor

❓ Type of change

  • 👌 Enhancement

📚 Description

Adds aria-disabled to the element acting as a button inside FileUpload. My use case is supporting this:

:root[data-use-pointer-cursors="true"]
	:where(a[href], button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"], label[for], summary):not(:disabled):not([aria-disabled="true"]) {
	cursor: pointer;
}

@innocenzi innocenzi requested a review from benjamincanac as a code owner June 29, 2026 07:23
@github-actions github-actions Bot added the v4 #4488 label Jun 29, 2026
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

In FileUpload.vue, a single conditional :aria-disabled attribute binding is added to the root dropzone/button element. The binding is applied only when variant === 'button' and reflects the computed disabled state, enabling assistive technologies to detect the disabled status in button mode.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description directly matches the change and explains the CSS pointer-cursor use case.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately describes the main change: adding aria-disabled to FileUpload when disabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jun 29, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/ui@6653

commit: 9554e5b

@innocenzi innocenzi marked this pull request as ready for review June 29, 2026 16:58
@benjamincanac benjamincanac changed the title fix(file-upload): add aria-disabled attribute when disabled fix(FileUpload): add aria-disabled attribute when disabled Jul 2, 2026

@benjamincanac benjamincanac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think aria-disabled is redundant on the button variant since native disabled already covers it. The variant that actually needs it is area (a <div role="button">). Could you flip it?

:aria-disabled="variant === 'button' ? undefined : (disabled || undefined)"

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

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants