Skip to content

Commit fc0add8

Browse files
authored
fix (table of contents): scroll top offset not working (#3640)
1 parent b9b0d41 commit fc0add8

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/block/table-of-contents/schema.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,18 @@ export const attributes = ( version = VERSION ) => {
148148
versionDeprecated: '',
149149
} )
150150

151+
attrObject.add( {
152+
attributes: {
153+
scrollTopOffset: {
154+
type: 'number',
155+
default: '',
156+
stkResponsive: true,
157+
},
158+
},
159+
versionAdded: '3.19.3',
160+
versionDeprecated: '',
161+
} )
162+
151163
return attrObject.getMerged( version )
152164
}
153165
export default attributes( VERSION )

src/block/table-of-contents/style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ blockStyles.addBlockStyles( 'isSmoothScroll', [ {
121121
valueCallback: value => ( value ? 'smooth' : undefined ),
122122
} ] )
123123

124-
blockStyles.addBlockStyle( 'scrollTopOffset', [ {
124+
blockStyles.addBlockStyles( 'scrollTopOffset', [ {
125125
selector: 'html',
126126
styleRule: 'scroll-padding-top',
127127
attrName: 'scrollTopOffset',

0 commit comments

Comments
 (0)