mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 08:19:07 +00:00
Merge pull request #14351 from strapi/relations/search-on-open
[Relations] Search on open
This commit is contained in:
commit
98109250ea
@ -97,6 +97,10 @@ export const RelationInputWrapper = ({
|
||||
searchFor(term, { idsToOmit: modifiedData?.[name]?.connect?.map((relation) => relation.id) });
|
||||
};
|
||||
|
||||
const handleOpenSearch = () => {
|
||||
searchFor('', { idsToOmit: modifiedData?.[name]?.connect?.map((relation) => relation.id) });
|
||||
};
|
||||
|
||||
const handleSearchMore = () => {
|
||||
search.fetchNextPage();
|
||||
};
|
||||
@ -143,7 +147,7 @@ export const RelationInputWrapper = ({
|
||||
onSearch={(term) => handleSearch(term)}
|
||||
onSearchNextPage={() => handleSearchMore()}
|
||||
onSearchClose={() => {}}
|
||||
onSearchOpen={() => {}}
|
||||
onSearchOpen={handleOpenSearch}
|
||||
placeholder={formatMessage(
|
||||
placeholder || {
|
||||
id: getTrad('relation.add'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user