It works!
This commit is contained in:
parent
cf08a4ecf0
commit
94664892e4
14
src/TA.tsx
14
src/TA.tsx
@ -1,4 +1,4 @@
|
||||
import {ReactNode} from "react";
|
||||
import {ReactNode, useCallback} from "react";
|
||||
import AsyncSelect from "react-select/async";
|
||||
import {FixedSizeList as List} from "react-window";
|
||||
import Select, {createFilter, MenuListProps} from "react-select";
|
||||
@ -69,6 +69,11 @@ const TestSelect = (vendorOptions: any) => {
|
||||
)
|
||||
}
|
||||
|
||||
interface Option {
|
||||
value: string,
|
||||
label: string,
|
||||
}
|
||||
|
||||
export function LargeSelect() {
|
||||
const {
|
||||
data: options,
|
||||
@ -83,13 +88,18 @@ export function LargeSelect() {
|
||||
return fullData.map(md => ({
|
||||
value: md.relativePath as string,
|
||||
label: md.fileName as string
|
||||
}));
|
||||
}) as Option);
|
||||
},
|
||||
});
|
||||
|
||||
const onChange = useCallback((value: Option) => {
|
||||
navigator.clipboard.writeText(`[[${value.label}]]`)
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className={"m-5"}>
|
||||
<Select
|
||||
onChange={onChange as any}
|
||||
components={{MenuList}}
|
||||
isLoading={isLoading}
|
||||
options={options}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user