Skip to content

Commit d9bb432

Browse files
chore(website): address Combobox nullable breaking change for headless-ui v2
see tailwindlabs/headlessui#3064
1 parent 52437b7 commit d9bb432

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

website/src/components/SearchPage/SearchFullUI.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ import { getLapisUrl } from '../../config.ts';
1515
import { lapisClientHooks } from '../../services/serviceHooks.ts';
1616
import { pageSize } from '../../settings';
1717
import type { Group } from '../../types/backend.ts';
18-
import { type MetadataFilter, type Schema, type GroupedMetadataFilter, type FieldValues } from '../../types/config.ts';
18+
import {
19+
type MetadataFilter,
20+
type Schema,
21+
type GroupedMetadataFilter,
22+
type FieldValues,
23+
type SetAFieldValue,
24+
} from '../../types/config.ts';
1925
import { type OrderBy } from '../../types/lapis.ts';
2026
import type { ReferenceGenomesSequenceNames } from '../../types/referencesGenomes.ts';
2127
import type { ClientConfig } from '../../types/runtimeConfig.ts';
@@ -160,7 +166,7 @@ export const InnerSearchFullUI = ({
160166
return values;
161167
}, [state, hiddenFieldValues]);
162168

163-
const setAFieldValue = (fieldName: string, value: string | number) => {
169+
const setAFieldValue: SetAFieldValue = (fieldName, value) => {
164170
setState((prev: any) => {
165171
const newState = {
166172
...prev,

website/src/components/SearchPage/fields/AutoCompleteField.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type AutoCompleteFieldProps = {
1010
field: MetadataFilter | GroupedMetadataFilter;
1111
setAFieldValue: SetAFieldValue;
1212
lapisUrl: string;
13-
fieldValue?: string | number;
13+
fieldValue?: string | number | null;
1414
lapisSearchParameters: Record<string, any>;
1515
};
1616

website/src/types/config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,5 @@ export const websiteConfig = z.object({
117117
});
118118
export type WebsiteConfig = z.infer<typeof websiteConfig>;
119119

120-
export type FieldValues = Record<string, string | number>;
121-
export type SetAFieldValue = (fieldName: string, value: string | number) => void;
120+
export type FieldValues = Record<string, string | number | null>;
121+
export type SetAFieldValue = (fieldName: string, value: string | number | null) => void;

0 commit comments

Comments
 (0)