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

View File

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

View File

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

View File

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