searchfield icon indicating copy to clipboard operation
searchfield copied to clipboard

SearchField dropdown closes when scrolling or dragging, losing focus prematurely

Open emadaltaki opened this issue 4 months ago • 2 comments

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

  1. Steps to reproduce the behavior:
  2. Place SearchField inside a scrollable parent (e.g., SingleChildScrollView or ListView).
  3. Focus the text field to open the dropdown suggestions.
  4. Try to scroll or drag the page downward to reveal the full dropdown.
  5. Notice the text field loses focus and the dropdown closes immediately.

Expected behavior

  1. The screen should scroll automatically enough to show the entire dropdown suggestions.
  2. 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

  1. The screen scrolls only enough to show the text field, but the dropdown is clipped off-screen.
  2. Manually scrolling or dragging causes the text field to lose focus immediately, which closes the dropdown—even if dragging is still in progress.

Screenshots

Image

emadaltaki avatar Jul 25 '25 00:07 emadaltaki