Skip to content

Fix Expensify Card search field auto-clearing on no results#95997

Closed
luacmartins wants to merge 1 commit into
mainfrom
cmartins-fixExpensifyCardSearchAutoClear
Closed

Fix Expensify Card search field auto-clearing on no results#95997
luacmartins wants to merge 1 commit into
mainfrom
cmartins-fixExpensifyCardSearchAutoClear

Conversation

@luacmartins

@luacmartins luacmartins commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

WorkspaceExpensifyCardsTable was the only Table consumer nesting Table.FilterBar/Table.NoResultsState/Table.Header inside ListHeaderComponent instead of rendering them as direct <Table> children.

Since #94705, TableBody returns null (unmounting the FlashList + ListHeaderComponent) when a search yields no results. That unmounted the search input, whose unmount effect resets the search string, flipping the empty state back off and remounting with a cleared field.

Fix: render the header content as a direct <Table> child, matching every other table.

Fixed Issues

$ #95960
PROPOSAL:

Tests

  1. Workspace Settings > Expensify Card
  2. Search for a term with no matches
  3. Verify "no results" state shows and the search field keeps the typed text
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

Same as Tests

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed
  • I verified there are no console errors
  • I followed proper code patterns
  • I tested other components that can be impacted by my changes
  • I added unit tests for any new feature or bug fix in this PR

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Render the card list header (search bar, no-results state, table
header) as direct children of Table instead of via the FlashList's
ListHeaderComponent, matching every other Table consumer. Table.Body
unmounts the FlashList (and thus ListHeaderComponent) when a search
yields no results, which was unmounting the search input and firing
its unmount-reset effect, clearing the typed search text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant