|
|
@ -14,8 +14,8 @@ const SplitKeys = ["Tab", "Enter", " ", ",", ";"];
|
|
|
|
|
|
|
|
|
|
|
|
export interface ChipsProps {
|
|
|
|
export interface ChipsProps {
|
|
|
|
disabled?: boolean;
|
|
|
|
disabled?: boolean;
|
|
|
|
defaultValue?: string[];
|
|
|
|
defaultValue?: readonly string[];
|
|
|
|
value?: string[];
|
|
|
|
value?: readonly string[];
|
|
|
|
onChange?: (v: string[]) => void;
|
|
|
|
onChange?: (v: string[]) => void;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -25,7 +25,7 @@ export const Chips: FunctionComponent<ChipsProps> = ({
|
|
|
|
disabled,
|
|
|
|
disabled,
|
|
|
|
onChange,
|
|
|
|
onChange,
|
|
|
|
}) => {
|
|
|
|
}) => {
|
|
|
|
const [chips, setChips] = useState<string[]>(() => {
|
|
|
|
const [chips, setChips] = useState<Readonly<string[]>>(() => {
|
|
|
|
if (value) {
|
|
|
|
if (value) {
|
|
|
|
return value;
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|