Skip to content
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

Invokes onChange() handler of DigitsInput component with null when input value is NaN #19

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kemuridama
Copy link
Member

@kemuridama kemuridama commented Apr 16, 2024

📝 概要

DigitsInput は内部で数字への parse に失敗したときに NaN とともに onChange() handler が呼び出される.

image

そのため利用側で NaN を考慮したロジックを実装する必要が出てくる.

本来 DigitsInput では NaN を取り扱うことは想定していないはずなので, Number.isFinite() を使って parse された値が有限数であるか check を行い, 有限数であれば parse された値, そうではない場合は null とともに onChange() を呼び出すように修正した.

image

😛 やってないこと

✔️ 動作確認

  • Storybook で 〇〇 が XX できるのを確認

@mascii mascii self-requested a review April 23, 2024 01:03
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.

1 participant