Skip to content

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

Merged
benjamincanac merged 4 commits into
nuxt:v4from
innocenzi:fix/file-upload-aria-disabled
Jul 7, 2026
Merged

fix(FileUpload): add aria-disabled attribute when disabled#6653
benjamincanac merged 4 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 39e4d287-c69b-4819-8c3b-0e8ef900102e

📥 Commits

Reviewing files that changed from the base of the PR and between c6ad4ff and 37690a8.

⛔ Files ignored due to path filters (2)
  • test/components/__snapshots__/FileUpload-vue.spec.ts.snap is excluded by !**/*.snap
  • test/components/__snapshots__/FileUpload.spec.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • src/runtime/components/FileUpload.vue
✅ Files skipped from review due to trivial changes (1)
  • src/runtime/components/FileUpload.vue

📝 Walkthrough

Walkthrough

In FileUpload.vue, the root element now conditionally sets aria-disabled based on variant. The attribute is omitted for the button variant and otherwise reflects the computed disabled state.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the change: FileUpload now sets aria-disabled when disabled.
Description check ✅ Passed The description is directly related to the change and explains the aria-disabled 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.
✨ 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: 37690a8

@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)"

@benjamincanac benjamincanac merged commit c3b2996 into nuxt:v4 Jul 7, 2026
20 checks passed
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