-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(select): 列表展开时定位置选中项 * test(select): add example and snapshot * feat(select): 修改useMemo为useCallback * feat: 缩小选中option范围的查询范围,从popup开始查询
- Loading branch information
Showing
7 changed files
with
131 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React, { useState } from "react"; | ||
|
||
import { Select } from "tdesign-react"; | ||
|
||
const options = []; | ||
for (let i = 0; i < 100; i++) { | ||
options.push({ label: `第 ${i} 项`, value: i }); | ||
} | ||
|
||
const SingleSelect = () => { | ||
const [value, setValue] = useState(50); | ||
|
||
const onChange = (value) => { | ||
setValue(value); | ||
}; | ||
|
||
return ( | ||
<Select | ||
options={options} | ||
defaultValue={value} | ||
onChange={onChange} | ||
style={{ width: 200 }} | ||
// multiple | ||
></Select> | ||
); | ||
}; | ||
|
||
export default SingleSelect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters