Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add id prop to ListView #39494

Merged
merged 1 commit into from
Mar 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/block-editor/src/components/list-view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const BLOCK_LIST_ITEM_HEIGHT = 36;
* @param {boolean} props.__experimentalFeatures Flag to enable experimental features.
* @param {boolean} props.__experimentalPersistentListViewFeatures Flag to enable features for the Persistent List View experiment.
* @param {boolean} props.__experimentalHideContainerBlockActions Flag to hide actions of top level blocks (like core/widget-area)
* @param {string} props.id Unique identifier for the root list element (primarily for a11y purposes).
* @param {Object} ref Forwarded ref
*/
function ListView(
Expand All @@ -69,6 +70,7 @@ function ListView(
__experimentalHideContainerBlockActions,
showNestedBlocks,
showBlockMovers,
id,
...props
},
ref
Expand Down Expand Up @@ -205,6 +207,7 @@ function ListView(
blockDropTarget={ blockDropTarget }
/>
<TreeGrid
id={ id }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that this component accepts arbitrary props and spreads them onto the underlying <table> element as ...props. Thus we are not adding a new prop to <TreeView>.

className="block-editor-list-view-tree"
aria-label={ __( 'Block navigation structure' ) }
ref={ treeGridRef }
Expand Down