Fix Expensify Card search field auto-clearing on no results#95997
Closed
luacmartins wants to merge 1 commit into
Closed
Fix Expensify Card search field auto-clearing on no results#95997luacmartins wants to merge 1 commit into
luacmartins wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
WorkspaceExpensifyCardsTablewas the onlyTableconsumer nestingTable.FilterBar/Table.NoResultsState/Table.HeaderinsideListHeaderComponentinstead of rendering them as direct<Table>children.Since #94705,
TableBodyreturnsnull(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
Offline tests
N/A
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveScreenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari