Skip to content

chore: Warn if user has interactive elements in their custom Picker value#9710

Merged
LFDanLu merged 2 commits intomainfrom
check_for_interactive
Feb 27, 2026
Merged

chore: Warn if user has interactive elements in their custom Picker value#9710
LFDanLu merged 2 commits intomainfrom
check_for_interactive

Conversation

@LFDanLu
Copy link
Member

@LFDanLu LFDanLu commented Feb 27, 2026

From audit

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Test should cover this, but feel free to test the S2 story and make sure that warnings don't appear or modify the story locally to confirm.

🧢 Your Project:

RSP

@github-actions github-actions bot added the S2 label Feb 27, 2026
@rspbot
Copy link

rspbot commented Feb 27, 2026

Comment on lines +495 to +499
let INTERACTIVE_ARIA_ROLES = new Set([
'application', 'button', 'checkbox', 'combobox', 'gridcell', 'link', 'menuitem',
'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'searchbox', 'separator',
'slider', 'spinbutton', 'switch', 'tab', 'textbox', 'treeitem'
]);
Copy link
Member Author

Choose a reason for hiding this comment

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

same set as in Pressable

@rspbot
Copy link

rspbot commented Feb 27, 2026

} as const;

// https://w3c.github.io/aria/#widget_roles
let INTERACTIVE_ARIA_ROLES = new Set([
Copy link
Member

@reidbarber reidbarber Feb 27, 2026

Choose a reason for hiding this comment

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

Seems like something we could make into a re-usable utility eventually.

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, will pull it out then

@LFDanLu LFDanLu added this pull request to the merge queue Feb 27, 2026
Merged via the queue into main with commit 742aeca Feb 27, 2026
29 checks passed
@LFDanLu LFDanLu deleted the check_for_interactive branch February 27, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants