Skip to content

Commit

Permalink
Document Outline: Use block client ID as unique 'key' (WordPress#68502)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: t-hamano <[email protected]>
  • Loading branch information
3 people authored Jan 7, 2025
1 parent d131a2c commit 0859461
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/editor/src/components/document-outline/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default function DocumentOutline( {
{ title }
</DocumentOutlineItem>
) }
{ headings.map( ( item, index ) => {
{ headings.map( ( item ) => {
// Headings remain the same, go up by one, or down by any amount.
// Otherwise there are missing levels.
const isIncorrectLevel =
Expand All @@ -184,7 +184,7 @@ export default function DocumentOutline( {

return (
<DocumentOutlineItem
key={ index }
key={ item.clientId }
level={ `H${ item.level }` }
isValid={ isValid }
isDisabled={ hasOutlineItemsDisabled }
Expand Down

0 comments on commit 0859461

Please sign in to comment.