MCPcopy Create free account
hub / github.com/react-component/select / Test

Class Test

docs/examples/multiple.tsx:16–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16class Test extends React.Component {
17 state = {
18 useAnim: false,
19 suffixIcon: null,
20 loading: false,
21 value: ['a10'],
22 searchValue: '',
23 };
24
25 onChange = (value, options) => {
26 console.log('onChange', value, options);
27 this.setState({
28 value,
29 });
30 };
31
32 onSelect = (...args) => {
33 console.log(args);
34 };
35
36 onDeselect = (...args) => {
37 console.log(args);
38 };
39
40 useAnim = (e) => {
41 this.setState({
42 useAnim: e.target.checked,
43 });
44 };
45
46 showArrow = (e) => {
47 this.setState({
48 suffixIcon: e.target.checked ? <div>arrow</div> : null,
49 });
50 };
51
52 loading = (e) => {
53 this.setState({
54 loading: e.target.checked,
55 });
56 };
57
58 setSearchValue = (val) => {
59 this.setState({
60 searchValue: val,
61 });
62 };
63
64 render() {
65 const { useAnim, loading, value, suffixIcon } = this.state;
66 return (
67 <div>
68 <h2>multiple select(scroll the menu)</h2>
69
70 <p>
71 <label htmlFor="useAnim">
72 anim
73 <input id="useAnim" checked={useAnim} type="checkbox" onChange={this.useAnim} />

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…