Skip to content

fix: omit disabledKeys from MenuSection#9997

Merged
snowystinger merged 2 commits into
mainfrom
9990
May 4, 2026
Merged

fix: omit disabledKeys from MenuSection#9997
snowystinger merged 2 commits into
mainfrom
9990

Conversation

@LFDanLu
Copy link
Copy Markdown
Member

@LFDanLu LFDanLu commented Apr 29, 2026

Closes #9990
Wasn't meant to expose this, users can set disabledKeys at the menu level or at the item level

✅ 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:

Check that S2 and RAC MenuSection no longer has disabledKeys as a prop

🧢 Your Project:

RSP

@rspbot
Copy link
Copy Markdown

rspbot commented Apr 29, 2026

Copy link
Copy Markdown
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

I don't recall, should selected keys also not be there? i guess they don't really affect navigation except for focusStrategy. Does that work?

@LFDanLu
Copy link
Copy Markdown
Member Author

LFDanLu commented Apr 29, 2026

@snowystinger yep they should, there are stories/tests covering them for Menu

@LFDanLu LFDanLu added the small review Easy to review PR label Apr 30, 2026
@LFDanLu LFDanLu added this pull request to the merge queue May 1, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 1, 2026
@snowystinger snowystinger added this pull request to the merge queue May 2, 2026
@snowystinger snowystinger removed this pull request from the merge queue due to a manual request May 2, 2026
@snowystinger snowystinger enabled auto-merge May 2, 2026 01:21
@rspbot
Copy link
Copy Markdown

rspbot commented May 2, 2026

@rspbot
Copy link
Copy Markdown

rspbot commented May 2, 2026

## API Changes

react-aria-components

/react-aria-components:MenuSection

 MenuSection <T extends {}> {
   aria-label?: string
   children?: ReactNode | ({}) => ReactElement
   className?: string = 'react-aria-MenuSection'
   defaultSelectedKeys?: 'all' | Iterable<Key>
   dependencies?: ReadonlyArray<any>
-  disabledKeys?: Iterable<Key>
   disallowEmptySelection?: boolean
   id?: Key
   items?: Iterable<{}>
   onSelectionChange?: (Selection) => void
   selectedKeys?: 'all' | Iterable<Key>
   selectionMode?: SelectionMode
   shouldCloseOnSelect?: boolean
   style?: CSSProperties
   value?: {}
 }

/react-aria-components:MenuSectionProps

 MenuSectionProps <T> {
   aria-label?: string
   children?: ReactNode | (T) => ReactElement
   className?: string = 'react-aria-MenuSection'
   defaultSelectedKeys?: 'all' | Iterable<Key>
   dependencies?: ReadonlyArray<any>
-  disabledKeys?: Iterable<Key>
   disallowEmptySelection?: boolean
   id?: Key
   items?: Iterable<T>
   onSelectionChange?: (Selection) => void
   selectedKeys?: 'all' | Iterable<Key>
   selectionMode?: SelectionMode
   shouldCloseOnSelect?: boolean
   style?: CSSProperties
   value?: T
 }

@react-spectrum/s2

/@react-spectrum/s2:MenuSection

 MenuSection <T extends {}> {
   aria-label?: string
   children?: ReactNode | (T) => ReactElement
   defaultSelectedKeys?: 'all' | Iterable<Key>
   dependencies?: ReadonlyArray<any>
-  disabledKeys?: Iterable<Key>
   disallowEmptySelection?: boolean
   id?: Key
   items?: Iterable<T>
   onSelectionChange?: (Selection) => void
   selectionMode?: SelectionMode
   shouldCloseOnSelect?: boolean
   value?: T
 }

/@react-spectrum/s2:MenuSectionProps

 MenuSectionProps <T extends {}> {
   aria-label?: string
   children?: ReactNode | (T) => ReactElement
   defaultSelectedKeys?: 'all' | Iterable<Key>
   dependencies?: ReadonlyArray<any>
-  disabledKeys?: Iterable<Key>
   disallowEmptySelection?: boolean
   id?: Key
   items?: Iterable<T>
   onSelectionChange?: (Selection) => void
   selectionMode?: SelectionMode
   shouldCloseOnSelect?: boolean
   value?: T
 }

@snowystinger snowystinger added this pull request to the merge queue May 2, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 2, 2026
@snowystinger snowystinger added this pull request to the merge queue May 4, 2026
Merged via the queue into main with commit 5699465 May 4, 2026
29 checks passed
@snowystinger snowystinger deleted the 9990 branch May 4, 2026 02:59
@yihuiliao yihuiliao added the Menu label May 11, 2026
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.

Menu with section + multi selection + disabledKeys breaks keyboard navgation

5 participants