-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: Do not respond to the Enter event when data is loading #257
Conversation
Co-authored-by: afc163 <[email protected]>
// loading skip | ||
if (loading) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要 stopMeasure 么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该不用吧 这里关掉的话 就需要重新输入才会搜索了(input 里的text就不完整了)
@@ -101,6 +102,7 @@ const InternalMentions = forwardRef<MentionsRef, MentionsProps>( | |||
options, | |||
open, | |||
allowClear, | |||
silent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
怎么改成 silent 了?不是 loading 么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loading 是 antd 中的,rc-mentions 里是没有 loading 态的
@@ -40,6 +40,10 @@ describe('Mentions', () => { | |||
return render(createMentions(props)); | |||
} | |||
|
|||
beforeEach(() => { | |||
jest.useFakeTimers(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
把下面的 beforeEach 和 afterEach 挪上来把,反正也是 fakeTimer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
把下面的 beforeEach 和 afterEach 挪上来把,反正也是 fakeTimer
done
新增 loading 字段
在异步加载数据场景下 当 loading=true 时不响应 Enter 事件