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

fix(currency-input): Fix CurrencyInput not changing when empty value #283

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

diogomateus
Copy link
Collaborator

What this PR does

This PR fixes the issue where CurrencyInput onChange was not triggering when the value was empty.
This PR also updates CurrencyInput to use storybook stories instead of mdx documentation.

How to test?

Remove the first if of the condition and observe that the empty value isn't triggering:

 if (shadowValue === '' && value) {
      onChange?.(null)
    } else if (shadowValue) {
      onChange?.(reverseFormatInput(shadowValue));
    }

Checklist:

  • I reviewed my own code
  • The changes align with the designs I received
    Or give a reason why this does not apply:
  • I have attached screenshot(s), video(s) or gif(s) showing that the solution is working as expected
    Or give a reason why this does not apply:
  • I have updated the task(s) status on Linear
  • All new media is optimized (images, gifs, videos)

Browser support

My code works in the following browsers:

  • Firefox
  • Chrome
  • Safari
  • Edge

@diogomateus
Copy link
Collaborator Author

We should add more in-depth tests to this component in a following PR to be sure 👍

@diogomateus diogomateus merged commit 809497c into main Nov 27, 2023
4 checks passed
@diogomateus diogomateus deleted the diogo/currency-input-empty branch November 27, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants