[ticket/12567] wrap to top

[PHPBB3-12567](https://tracker.phpbb.com/browse/PHPBB3-12567)