searchfield
searchfield copied to clipboard
SearchField dropdown closes when scrolling or dragging, losing focus prematurely
Describe the bug
When using the SearchField widget inside a scrollable page, the dropdown suggestions appear but the screen does not scroll down enough to fully show the dropdown below the text field. Additionally, if you manually scroll or drag the page to try to reveal the dropdown, the text field loses focus, causing the dropdown to close immediately—even if you are dragging.
To Reproduce
- Steps to reproduce the behavior:
- Place SearchField inside a scrollable parent (e.g., SingleChildScrollView or ListView).
- Focus the text field to open the dropdown suggestions.
- Try to scroll or drag the page downward to reveal the full dropdown.
- Notice the text field loses focus and the dropdown closes immediately.
Expected behavior
- The screen should scroll automatically enough to show the entire dropdown suggestions.
- If the user manually scrolls or drags to reveal the dropdown, the text field should not lose focus and the dropdown should remain open during drag.
Actual behavior
- The screen scrolls only enough to show the text field, but the dropdown is clipped off-screen.
- Manually scrolling or dragging causes the text field to lose focus immediately, which closes the dropdown—even if dragging is still in progress.
Screenshots