Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
现在,Dropdown有一个bug,如果触发滚动的元素在一个可以滚动的div内,div滚动时dropdown的位置不会更新。
虽然现在有一个getPopupContainer的属性,但是这个属性局限性很大,比如有下面两个问题:
一:zIndex的问题,如果dropdown的popup在div内,有时候会被遮挡。
二:多层滚动嵌套时。
解决方法:监听所有的滚动事件, 只要是trgger的父元素滚动,就重新定位。
这里使用事件捕获而不是事件冒泡,因为滚动事件不会冒泡到根元素。