mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-25 08:06:48 +08:00
Fix: Optimized Input and MultiSelect component functionality and dataSet-chunk page styling #9779 (#9815)
### What problem does this PR solve? Fix: Optimized Input and MultiSelect component functionality and dataSet-chunk page styling - Updated @js-preview/excel to version 1.7.14 #9779 - Optimized the EditTag component - Updated the Input component to optimize numeric input processing - Adjusted the MultiSelect component to use lodash's isEmpty method - Optimized the CheckboxSets component to display action buttons based on the selected state ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -29,6 +29,7 @@ import {
|
||||
} from '@/components/ui/popover';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { isEmpty } from 'lodash';
|
||||
|
||||
export type MultiSelectOptionType = {
|
||||
label: React.ReactNode;
|
||||
@ -209,13 +210,17 @@ export const MultiSelect = React.forwardRef<
|
||||
const [isAnimating, setIsAnimating] = React.useState(false);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!selectedValues?.length && props.value) {
|
||||
if (isEmpty(selectedValues) && !isEmpty(props.value)) {
|
||||
setSelectedValues(props.value as string[]);
|
||||
}
|
||||
}, [props.value, selectedValues]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!selectedValues?.length && !props.value && defaultValue) {
|
||||
if (
|
||||
isEmpty(selectedValues) &&
|
||||
isEmpty(props.value) &&
|
||||
!isEmpty(defaultValue)
|
||||
) {
|
||||
setSelectedValues(defaultValue);
|
||||
}
|
||||
}, [defaultValue, props.value, selectedValues]);
|
||||
|
||||
Reference in New Issue
Block a user