Skip to content

Commit 7e61ace

Browse files
chore(website): appease typescript for headlessui v2 upgrade for nullable combobox
Headlessui v2 makes it necessary to handle null input for combobox. See tailwindlabs/headlessui#3064
1 parent 4501522 commit 7e61ace

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,14 @@ export const MutationField: FC<MutationFieldProps> = ({ referenceGenomesSequence
168168
setOptions(newOptions);
169169
};
170170

171-
const handleOptionClick = (option: MutationQuery[] | MutationQuery) => {
171+
const handleOptionClick = (option: MutationQuery[] | MutationQuery | null) => {
172172
if (Array.isArray(option)) {
173173
option = option[0];
174174
}
175+
// Unclear how to handle null here, necessary since headlessui v2
176+
if (!option) {
177+
return;
178+
}
175179
const newSelectedOptions = [...selectedOptions, option];
176180
onChange(serializeMutationQueries(newSelectedOptions));
177181
setInputValue('');

0 commit comments

Comments
 (0)