react-notion-x
react-notion-x copied to clipboard
defaultPageCoverPosition is ignored if the notion page used to have a cover
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.
Great catch 💯
And thanks for the in-depth issue description + PR.