react-notion-x icon indicating copy to clipboard operation
react-notion-x copied to clipboard

defaultPageCoverPosition is ignored if the notion page used to have a cover

Open FranciscoMoretti opened this issue 3 years ago • 1 comments
trafficstars

Description

Notion pages seem to keep the page_cover_position in a page format even if the cover was removed. The Block component from packages/react-notion-x/src/block.tsx uses the page_cover_position from the page format if it's available instead of the defaultPageCoverPosition.

The problem happens when using NotionRenderer with defaultPageCover and defaultPageCoverPosition with a page that used to have a cover. In this case it uses the page_cover_position from the cover that was removed with the defaultPageCover. defaultPageCoverPosition is ignored.

Notion Test Page ID

This page used to have a cover and has a numeric page_cover_position value as part of its format. It doesn't have page_cover as part of its format.

FranciscoMoretti avatar Aug 13 '22 18:08 FranciscoMoretti

Great catch 💯

And thanks for the in-depth issue description + PR.

transitive-bullshit avatar Aug 14 '22 19:08 transitive-bullshit