Skip to content

fix: add null check of arrowRef.current #644

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

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

zerosrat
Copy link
Contributor

@zerosrat zerosrat commented Jun 1, 2023

When evaluating arrowRef.current.offsetLeft, maybe arrowRef.current is null. As a result it throws undefined is not an object error.

So I add a null check before.

@zombieJ

close ant-design/ant-design#42849

@vercel
Copy link

vercel bot commented Jun 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
picker ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 1, 2023 0:34am

@zombieJ
Copy link
Member

zombieJ commented Jun 6, 2023

加个 测试?

@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Merging #644 (d726704) into master (2412675) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head d726704 differs from pull request most recent head 4e19bc8. Consider uploading reports for the commit 4e19bc8 to get more accurate results

@@           Coverage Diff           @@
##           master     #644   +/-   ##
=======================================
  Coverage   99.20%   99.20%           
=======================================
  Files          52       52           
  Lines        2397     2398    +1     
  Branches      705      718   +13     
=======================================
+ Hits         2378     2379    +1     
  Misses         17       17           
  Partials        2        2           
Impacted Files Coverage Δ
src/RangePicker.tsx 99.27% <100.00%> (+<0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@zerosrat
Copy link
Contributor Author

zerosrat commented Jun 6, 2023

加个 测试?

arrowRef.current 为空的时候,就不计算 arrowLeftpanelLeft,会影响样式。
如果要写测试的话,是测试什么 case 哇?

@zombieJ
Copy link
Member

zombieJ commented Jun 6, 2023

看起来是没啥测试的必要

@zombieJ zombieJ merged commit 82fb089 into react-component:master Jun 6, 2023
@zombieJ
Copy link
Member

zombieJ commented Jun 6, 2023

+ [email protected]

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.

react-component/picker的pr等待处理
2 participants