Skip to content

Commit 89dc817

Browse files
committed
Leaving out default value, and checking for definition instead of null value in the filtering logic
1 parent 587d760 commit 89dc817

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/block-library/src/table-of-contents/block.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
"default": false
2222
},
2323
"maxLevel": {
24-
"type": [ "number", "null" ],
25-
"default": null
24+
"type": "number"
2625
}
2726
},
2827
"supports": {

packages/block-library/src/table-of-contents/hooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function getLatestHeadings( select, clientId ) {
102102
const headingAttributes = getBlockAttributes( blockClientId );
103103

104104
// Skip headings that are deeper than maxLevel
105-
if ( maxLevel !== null && headingAttributes.level > maxLevel ) {
105+
if ( maxLevel && headingAttributes.level > maxLevel ) {
106106
continue;
107107
}
108108

0 commit comments

Comments
 (0)