fix: 修复 Select 使用键盘方向键循环导航后继续向上,下拉列表内容区域白屏的问题#2222
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
问题描述
修复
Select组件使用键盘方向键循环导航(到达列表顶部后继续向上),下拉列表内容区域出现白屏的问题。问题原因
在
OptionList.tsx中,当用户向上导航且currentIndex < 0时,代码将currentIndex重置为max(列表最大索引),导致scrollTop计算出现异常,从而引发白屏。修复方案
将循环到顶部时的
currentIndex由max改为0,避免异常的滚动位置计算。变更内容
src/Select/OptionList.tsx: 修复键盘导航边界处理逻辑package.json/src/index.js: 版本号升级至2.0.32-beta.8site/pages/documentation/changelog/2.x.x.md: 更新 changelog