Description
When navigating through the modal using the arrow up key, the previous element is not fully visible.
Instead, it's only partially displayed, which makes it difficult for users to see the entire content of the previous element.
This issue was first encountered on the Vue documentation site but is reproducible wherever DocSearch is embedded.
Steps to reproduce
- Go to playground
- Open the modal.
- Scroll down within the modal to a point where the previous element is partially visible or fully invisible.
- Use the arrow up key to navigate to the previous element.
Expected behavior
When navigating to the previous element using the arrow up key, the element should be fully visible within the modal.
Current behavior:

Proposed solution:

Description
When navigating through the modal using the arrow up key, the previous element is not fully visible.
Instead, it's only partially displayed, which makes it difficult for users to see the entire content of the previous element.
This issue was first encountered on the Vue documentation site but is reproducible wherever DocSearch is embedded.
Steps to reproduce
Expected behavior
When navigating to the previous element using the arrow up key, the element should be fully visible within the modal.
Current behavior:

Proposed solution:
