Floating search box cannot be closed when device goes from horizontal to vertical

Platform:
try.discourse.org (can reproduce in Safe Mode)
Edge 144.0.3719.91
MIUI 13.0.14 on Android 12
Mi 11 Lite

Description:
Floating search box persists and cannot be closed when device goes from horizontal to vertical, must flip to horizontal to close it.

Reproducible steps:

  1. Rotate the device to horizontal.

  2. Enter a topic.

  3. If safe mode is not enabled, scroll down a little to show the search icon.

  4. Tap the search icon and you should see the popover:

  5. Flip device to vertical.

  6. Expected: search box disappears. Actual: persists across page navigations and can only be closed by tapping outside it when the device is horizontal.