Skip to content
New issue

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

fix(Select): dropdown rendering blank #7539 #7674

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hdmy
Copy link

@hdmy hdmy commented Jun 20, 2024

背景:
使用dropdownRenderASelect进行自由扩展,在ASelect有焦点的情况下且滚动条滚动超过一页时,点击下拉会出现选项空白,完整讨论见 Issue官方文档可复现。
image

对比流程:
ASelect不聚焦时,点击下拉框,会触发onContainerFocus等方法,在onContainerFocus方法中用setTimeout延迟修改mockFocusedmockFocused变化会引起ListonUpdated的执行,此时列表已渲染完成,offsetHeight能被正确赋值,触发了 watcher,更新state.scrollTop,进而更新到calRes.offset中。

ASelect聚焦时,点击下拉框,不会触发onContainerFocus方法,导致offsetHeight未能正确赋值,进而calRes.offset未能正确计算,导致List未能正确滚动到历史停留位置,出现选项空白。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant