Skip to content

Conversation

icaife
Copy link
Contributor

@icaife icaife commented Mar 11, 2022

🤔 这个变动的性质是?

  • 新特性提交
  • [ x ] 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

https://codesandbox.io/s/laughing-fog-b12ijp?file=/src/App.js
当labelInValue=true mode=multiple的时候,value不在options内,删除会导致报错。

Select.tsx 447行:
const option = getMixedOption(val); // option可能为undefined,导致 option.key 抛出错误

Uploading jserror.png…

📝 更新日志

语言 更新描述
🇺🇸 英文
🇨🇳 中文

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@vercel
Copy link

vercel bot commented Mar 11, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/select/Hkf9Dcqz6UpECWJajc1Vq51xDNpJ
✅ Preview: https://select-git-fork-icaife-fix-js-error-when-remove-react-component.vercel.app

@afc163
Copy link
Member

afc163 commented Mar 12, 2022

别改 example,加个用例。

@codecov
Copy link

codecov bot commented Mar 12, 2022

Codecov Report

Merging #723 (c184d24) into master (4bc806f) will not change coverage.
The diff coverage is 100.00%.

❗ Current head c184d24 differs from pull request most recent head 26a68ff. Consider uploading reports for the commit 26a68ff to get more accurate results

@@           Coverage Diff           @@
##           master     #723   +/-   ##
=======================================
  Coverage   99.50%   99.50%           
=======================================
  Files          25       25           
  Lines        1010     1010           
  Branches      320      320           
=======================================
  Hits         1005     1005           
  Misses          4        4           
  Partials        1        1           
Impacted Files Coverage Δ
src/Select.tsx 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@icaife
Copy link
Contributor Author

icaife commented Mar 13, 2022

测试用例已加,还原了example

@afc163 afc163 merged commit a90fceb into react-component:master Mar 14, 2022
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.

2 participants