iblq / antd-virtual-select Goto Github PK
View Code? Open in Web Editor NEWLong list optimization antd select component
Long list optimization antd select component
感觉还是很实用的一个组件哇 😁
代码里写死了dropdownClassName
,这样外部引用时传入这个属性并不会被传给antd
这段代码是否修改成别的变量名,最后传入的时候拼接这个变量名和外部传入的dropdownClassName
会更好?
this.dropdownClassName = `dc${+new Date()}`;
涉及的源码: defaultV = value || defaultValue || defaultV ?
目前项目引入 antd 是使用按需加载的,但引入该组件后,发送所有引用到改组件的打包文件都包含全量的 antd 打包文件,猜测是 import { Select } from 'antd'
这段代码导致的,应该改为 import Select from 'antd/es/select'
[email protected]
[email protected]
搜索时候,下拉内容少于可视区域时候,出现了滚动条,里面 ul[role=listbox]高度没有重置
还一个,[email protected] 版本下拉框开启输入搜索时候,点击输入框光标是不消失的,小问题,你可以看下,先把上面那个问题修复了
可复现,使用官方 demo,使用 setTimeout 初始数据,如下:
setTimeout(() => {
for (let i = 0; i < 10000; i++) {
children.push(
<Option value={i + "aa"} key={i}>
{i}
</Option>
);
}
}, 3000)
在组件加载后的 3s 内,激活组件,dropmenu 高度为默认高度 100,3 s 后高度没更新,antd 原生是正常的。
考虑在 DropDownWrap 组件里,监听 allHeight props 更新重新 setState allHeight
reproduced link: https://codesandbox.io/s/superselect-s94w8
在第一次搜索(数据量很多)然后滚动不选择,在搜索一个数量相对少的,然后下拉就出不来了,再去搜索第一次那个数据较多,会出现空白,滚动后正常。
Sharing a quick example here: https://codesandbox.io/s/superselect-forked-cpbrq?file=/src/App.js
The dropdownRender prop works as expected in AntD but not when using SuperSelect. Any advice on how to make it work?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.