From e18c3c4717f82dc07608f56ff9371d0ac86b9f62 Mon Sep 17 00:00:00 2001 From: Mike Clark Date: Wed, 4 Oct 2023 21:55:42 +0100 Subject: [PATCH] autocomplete dropshift.js type complaining when using correct type for input.tsx. Fixed as per dropshift github issue --- .../src/components/autocomplete/Autocomplete.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx index 7f8365474fe..94b7bd8e943 100644 --- a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx +++ b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx @@ -398,7 +398,10 @@ function SingleAutocomplete({ }, onBlur: e => { // Should this be e.nativeEvent - e.preventDownshiftDefault = true; + // preventDownshiftDefault is a downshift.js property - they don't have types for it on the React event + // Suggested way to make this work with typescript is to cast as any... https://github.com/downshift-js/downshift/issues/734 + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (e as any).preventDownshiftDefault = true; inputProps.onBlur?.(e); if (!closeOnBlur) return;