-
Notifications
You must be signed in to change notification settings - Fork 611
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: disable modal button before press handler promise becomes to resolve state #1252
base: master
Are you sure you want to change the base?
Conversation
components/modal/AlertContainer.tsx
Outdated
} | ||
button.style = 'disabled' | ||
await originPress() |
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.
逻辑漏洞:originPress()
内执行reject将永远不可被点击
虽然可以让下面的代码不继续下去,
但是也会导致下一次点击时style值仍为'disabled'
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.
了解,我再修正一下
This comment was marked as outdated.
This comment was marked as outdated.
fixed: 1a9c367 |
收到!我rebase后再去测试一下 |
@1uokun 我在本地yarn start时发现DEMO无法运行,我尝试将错误信息中提到的babel相关依赖手动在左侧package.json中安装后仍然无法解决,请问你知道这是哪里的BUG吗? |
…on.style and call this.onClose()
60b5261
to
a431014
Compare
或者可以去 |
done了吗bro @cw1997 |
不好意思,最近公司这边也比较忙,这个我下周有空再来看看 目前example已经能够正常跑起来了,但是确认按钮切换显示loading状态的逻辑还是有点问题,这个我下周再来处理 |
First of all, thank you for your contribution! :-)
主要修复:当Model.alert的OK按钮的onPress为一个async function时,点击按钮后需要暂时将该按钮禁用,直到onPress函数的Promise被resolve后才能将OK按钮恢复为启用状态。另外,buttonStyle的生成逻辑也有问题,在这个PR顺带做了修复。
最后,我本地执行test:all和lint都出错,请问你们之前有遇到类似情况吗?是如何处理的呢?
Please makes sure that these checkboxes are checked before submitting your PR, thank you!
npm run lint
and fix those errors before submitting in order to keep consistent code style.Extra checklist:
if isBugFix :
elif isNewFeature :