mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 18:00:15 +01:00
🔍 feat: Filter MultiSelect and SelectDropDown (+variants) + CSS fixes for Scrollbar (#2138)
* Initial implementation of MultiSearch. Added implementation to MultiSelect and SelectDropDown and variants * Update scrollbar styles to prevent breakages on Chrome * Revert changes to vite.config.ts (redundant for now) * chore(New Chat): organize imports * style(scrollbar-transparent): use webkit as standard, expected behavior * chore: useCallback for mouse enter/leave * fix(Footer): resolve map key error * chore: memoize Conversations * style(MultiSearch): improve multisearch styling * style: dark mode search input * fix: react warnings due to unrecognize html props * chore: debounce OpenAI settings inputs * fix(useDebouncedInput): only use event value as newValue if not object --------- Co-authored-by: Flynn <gpg@flyn.ca>
This commit is contained in:
parent
f51ac74e12
commit
382b303963
20 changed files with 305 additions and 83 deletions
|
|
@ -19,7 +19,7 @@ function useDebouncedInput({
|
|||
initialValue: unknown;
|
||||
delay?: number;
|
||||
}): [
|
||||
React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>,
|
||||
(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement> | unknown) => void,
|
||||
unknown,
|
||||
SetterOrUpdater<string>,
|
||||
// (newValue: string) => void,
|
||||
|
|
@ -35,9 +35,12 @@ function useDebouncedInput({
|
|||
);
|
||||
|
||||
/** An onChange handler that updates the local state and the debounced option */
|
||||
const onChange: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement> = useCallback(
|
||||
(e) => {
|
||||
const newValue: unknown = e.target.value;
|
||||
const onChange = useCallback(
|
||||
(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement> | unknown) => {
|
||||
const newValue: unknown =
|
||||
typeof e !== 'object'
|
||||
? e
|
||||
: (e as React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>)?.target.value;
|
||||
setValue(newValue);
|
||||
setDebouncedOption(newValue);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue