Skip to content

Commit

Permalink
chore: backport fix for relation search (#19070)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaellis committed Dec 15, 2023
1 parent c469b9f commit 5404b0b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const RelationInput = ({

const handleMenuOpen = (isOpen) => {
if (isOpen) {
onSearch();
onSearch(textValue);
}
};

Expand Down Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
});
});

Expand All @@ -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),
},
Expand Down Expand Up @@ -316,15 +316,15 @@ describe('useRelation', () => {
expect(spy).toHaveBeenNthCalledWith(1, expect.any(String), {
params: {
_q: 'something',
_filter: '$startsWithi',
_filter: '$containsi',
limit: expect.any(Number),
page: 1,
},
});
expect(spy).toHaveBeenNthCalledWith(2, expect.any(String), {
params: {
_q: 'something',
_filter: '$startsWithi',
_filter: '$containsi',
limit: expect.any(Number),
page: 2,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const useRelation = (cacheKey, { relation, search }) => {
setSearchParams({
...options,
_q: term,
_filter: '$startsWithi',
_filter: '$containsi',
});
};

Expand Down

0 comments on commit 5404b0b

Please sign in to comment.