diff --git a/src/qqq/components/forms/ChipTextField.tsx b/src/qqq/components/forms/ChipTextField.tsx index 0b8a712..7ac76de 100644 --- a/src/qqq/components/forms/ChipTextField.tsx +++ b/src/qqq/components/forms/ChipTextField.tsx @@ -123,7 +123,15 @@ function ChipTextField({...props}) setChips(chipData); chipsRef.current = chipData; determineChipColors(); - }, [JSON.stringify(chipData)]); + + if (chipType !== "pvs") + { + const currentChipValidity = chips.map((chip, i) => + (chipType !== "number" || !Number.isNaN(Number(chips[i]))) + ); + setChipValidity(currentChipValidity); + } + }, [JSON.stringify(chipData), chips]); useEffect(() => { diff --git a/src/qqq/components/query/FilterCriteriaPaster.tsx b/src/qqq/components/query/FilterCriteriaPaster.tsx index 0107953..79655f9 100644 --- a/src/qqq/components/query/FilterCriteriaPaster.tsx +++ b/src/qqq/components/query/FilterCriteriaPaster.tsx @@ -298,6 +298,10 @@ function FilterCriteriaPaster({table, field, type, onSave}: Props): JSX.Element let regex = new RegExp(currentDelimiterCharacter); let parts = inputText.split(regex); let chipData = [] as string[]; + + ///////////////////////////////////////////////////////////////// + // use a map to keep track of the counts for each unique value // + ///////////////////////////////////////////////////////////////// const uniqueValuesMap: { [key: string]: number } = {}; /////////////////////////////////////////////////////// @@ -338,7 +342,7 @@ function FilterCriteriaPaster({table, field, type, onSave}: Props): JSX.Element if (type === "number") { let suffix = invalidCount === 1 ? " value is not a number" : " values are not numbers"; - setErrorText(invalidCount + suffix + "numbers and will not be added to the filter"); + setErrorText(invalidCount + suffix + " and will not be added to the filter"); } else if (type === "pvs") {