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: number field interactions #4124

Merged
merged 4 commits into from
Nov 17, 2020

Conversation

williamw2
Copy link
Contributor

@williamw2 williamw2 commented Nov 16, 2020

Description

Allow the number field to be empty while typing. Original logic would prevent the deletion of all numbers in the field since the onchange event handler would ignore the change if the current value was NaN. This changes allows an empty string to be a valid condition. This also fixes a similar issue if a default value is specified for the number field.

Motivation & context

Fixes #3806

Issue type checklist

  • Chore: A change that does not impact distributed packages.
  • Bug fix: A change that fixes an issue, link to the issue above.
  • New feature: A change that adds functionality.

Is this a breaking change?

  • This change causes current functionality to break.

Adding or modifying component(s) in @microsoft/fast-components checklist

Process & policy checklist

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Copy link
Contributor

@EisenbergEffect EisenbergEffect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a new test or two to assert the string deletion scenario stays fixed?

@williamw2
Copy link
Contributor Author

Should we add a new test or two to assert the string deletion scenario stays fixed?

Added a test for the empty string scenario.

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.

Can't delete first digit in attribute text field in fast-component-explorer
5 participants