chore: backport fix for relation search (#19070)

This commit is contained in:
Josh 2023-12-15 19:08:53 +00:00 committed by GitHub
parent c469b9f446
commit 5404b0b69b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -159,7 +159,7 @@ const RelationInput = ({
const handleMenuOpen = (isOpen) => {
if (isOpen) {
onSearch();
onSearch(textValue);
}
};
@ -221,7 +221,7 @@ const RelationInput = ({
<ComboboxWrapper marginRight="auto" maxWidth={size <= 6 ? '100%' : '70%'} width="100%">
<Combobox
ref={fieldRef}
autocomplete="list"
autocomplete="none"
error={error}
name={name}
hint={description}

View File

@ -688,7 +688,7 @@ exports[`Content-Manager || RelationInput should render and match snapshot 1`] =
class="c10 c11"
>
<input
aria-autocomplete="list"
aria-autocomplete="none"
aria-controls="radix-:r4:"
aria-describedby="1-hint 1-error"
aria-disabled="false"

View File

@ -257,7 +257,7 @@ describe('useRelation', () => {
});
expect(spy).toBeCalledWith('/', {
params: { _q: 'something', _filter: '$startsWithi', limit: 10, page: 1 },
params: { _q: 'something', _filter: '$containsi', limit: 10, page: 1 },
});
});
@ -284,7 +284,7 @@ describe('useRelation', () => {
expect(spy).toBeCalledWith(expect.any(String), {
params: {
_q: 'something',
_filter: '$startsWithi',
_filter: '$containsi',
limit: 5,
page: expect.any(Number),
},
@ -316,7 +316,7 @@ describe('useRelation', () => {
expect(spy).toHaveBeenNthCalledWith(1, expect.any(String), {
params: {
_q: 'something',
_filter: '$startsWithi',
_filter: '$containsi',
limit: expect.any(Number),
page: 1,
},
@ -324,7 +324,7 @@ describe('useRelation', () => {
expect(spy).toHaveBeenNthCalledWith(2, expect.any(String), {
params: {
_q: 'something',
_filter: '$startsWithi',
_filter: '$containsi',
limit: expect.any(Number),
page: 2,
},

View File

@ -166,7 +166,7 @@ export const useRelation = (cacheKey, { relation, search }) => {
setSearchParams({
...options,
_q: term,
_filter: '$startsWithi',
_filter: '$containsi',
});
};