I'm not sure to understand why it's closed as duplicate because in my opinion this issue more related to the fact that the margin is not handled correctly. Also this issue happen with firefox whereas XWIKI-24677 happen only with chromium and is more about the fact that pagejs is not able to continue the TOC on the next page. It's true that the issue on the button it's related to XWIKI-24677 but not the issue on the left.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.