Skip to content

[docs] Improve TransferList examples#48845

Merged
silviuaavram merged 3 commits into
mui:masterfrom
silviuaavram:docs/improve-transfer-list
Jul 24, 2026
Merged

[docs] Improve TransferList examples#48845
silviuaavram merged 3 commits into
mui:masterfrom
silviuaavram:docs/improve-transfer-list

Conversation

@silviuaavram

@silviuaavram silviuaavram commented Jul 23, 2026

Copy link
Copy Markdown
Member

The TransferList examples could use some refresh.

  • use MenuList instead of List to make use of the roving tabindex strategy.
  • fix the lost focus after clicking any of the transfer buttons, now focus is managed to the list receiving the items.
  • remove the "checked" status of the items we move through "transfer all", aligning the behavior with "transfer checked"
  • make the select all checkbox small to visually align with the others, also reduce the vertical padding of its card header
  • extract the custom list into separate components.

Preview: https://deploy-preview-48845--material-ui.netlify.app/material-ui/react-transfer-list/

@silviuaavram silviuaavram self-assigned this Jul 23, 2026
Copilot AI review requested due to automatic review settings July 23, 2026 08:46
@silviuaavram silviuaavram added docs Improvements or additions to the documentation. accessibility a11y scope: transfer list Changes related to the transfer list. labels Jul 23, 2026
@code-infra-dashboard

code-infra-dashboard Bot commented Jul 23, 2026

Copy link
Copy Markdown

Deploy preview

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Refreshes the TransferList documentation demos to improve keyboard navigation and focus handling by adopting MenuList (roving tab index), refining transfer behaviors, and extracting reusable list rendering into components.

Changes:

  • Replaced List/ListItemButton with MenuList/MenuItem in TransferList demos to leverage roving tab index behavior.
  • Added explicit focus management after transfers so focus moves to the receiving list.
  • Adjusted “transfer all” behavior to clear moved items from the checked set; tweaked Select All header density (smaller checkbox, reduced padding) and extracted custom list components.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
docs/data/material/components/transfer-list/TransferList.tsx Switches list rendering to MenuList/MenuItem, extracts CustomList, adds focus management and aligns “transfer all” checked-state behavior.
docs/data/material/components/transfer-list/TransferList.js JS variant of the above demo changes (including extracted CustomList and focus/checked-state updates).
docs/data/material/components/transfer-list/SelectAllTransferList.tsx Extracts CustomList, uses MenuList/MenuItem, updates header checkbox sizing/padding, and adds focus management after transfers.
docs/data/material/components/transfer-list/SelectAllTransferList.js JS variant of the above demo changes (with CustomList + focus management and updated header styling).

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

Comment on lines +94 to +101
CustomList.propTypes = {
checked: PropTypes.arrayOf(PropTypes.number).isRequired,
handleToggle: PropTypes.func.isRequired,
handleToggleAll: PropTypes.func.isRequired,
items: PropTypes.arrayOf(PropTypes.number).isRequired,
numberOfChecked: PropTypes.func.isRequired,
title: PropTypes.node,
};

@ZeeshanTamboli ZeeshanTamboli 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.

Nice improvements.

@silviuaavram
silviuaavram merged commit 4d5fe72 into mui:master Jul 24, 2026
18 checks passed
@silviuaavram
silviuaavram deleted the docs/improve-transfer-list branch July 24, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility a11y docs Improvements or additions to the documentation. scope: transfer list Changes related to the transfer list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants