We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select
latest
搜索之后,点击选项
只在用户输入时触发搜索
import React from 'react'; import { debounce } from 'lodash-es'; import { Select } from '@douyinfe/semi-ui'; () => { const [loading, setLoading] = useState(false); const optionList = [ { value: 'douyin', label: '抖音', type: 1 }, { value: 'xingtu', label: '醒图', type: 2 }, { value: 'jianying', label: '剪映', type: 3 }, { value: 'toutiao', label: '今日头条', type: 4 }, ]; const [list, setList] = useState(optionList); const [value, setValue] = useState(''); const handleMultipleChange = newValue => { setValue(newValue); }; const handleSearch = inputValue => { setLoading(true); console.log('======') let result = []; if (inputValue) { let length = Math.ceil(Math.random() * 100); result = Array.from({ length }, (v, i) => { return { value: inputValue + i, label: `相近业务 ${inputValue}${i}`, type: i + 1 }; }); setTimeout(() => { setLoading(false); setList(result); }, 1000); } else { setLoading(false); } }; return ( <Select style={{ width: 300 }} filter remote onChangeWithObject multiple value={value} onSearch={debounce(handleSearch, 1000)} optionList={list} loading={loading} onChange={handleMultipleChange} emptyContent={null} /> ); };
- OS: - browser:
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is there an existing issue for this?
Which Component
Select
Semi Version
latest
Current Behavior
搜索之后,点击选项
Expected Behavior
只在用户输入时触发搜索
Steps To Reproduce
ReproducibleCode
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: