Skip to content

Commit

Permalink
autocomplete dropshift.js type complaining when using correct type fo…
Browse files Browse the repository at this point in the history
…r input.tsx. Fixed as per dropshift github issue
  • Loading branch information
MikesGlitch committed Oct 4, 2023
1 parent 9998f1d commit e18c3c4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e18c3c4

Please sign in to comment.