mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +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) });
|
searchFor(term, { idsToOmit: modifiedData?.[name]?.connect?.map((relation) => relation.id) });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleOpenSearch = () => {
|
||||||
|
searchFor('', { idsToOmit: modifiedData?.[name]?.connect?.map((relation) => relation.id) });
|
||||||
|
};
|
||||||
|
|
||||||
const handleSearchMore = () => {
|
const handleSearchMore = () => {
|
||||||
search.fetchNextPage();
|
search.fetchNextPage();
|
||||||
};
|
};
|
||||||
@ -143,7 +147,7 @@ export const RelationInputWrapper = ({
|
|||||||
onSearch={(term) => handleSearch(term)}
|
onSearch={(term) => handleSearch(term)}
|
||||||
onSearchNextPage={() => handleSearchMore()}
|
onSearchNextPage={() => handleSearchMore()}
|
||||||
onSearchClose={() => {}}
|
onSearchClose={() => {}}
|
||||||
onSearchOpen={() => {}}
|
onSearchOpen={handleOpenSearch}
|
||||||
placeholder={formatMessage(
|
placeholder={formatMessage(
|
||||||
placeholder || {
|
placeholder || {
|
||||||
id: getTrad('relation.add'),
|
id: getTrad('relation.add'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user