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

[Text Field] The specified value "NaN" cannot be parsed, or is out of range. #633

Open
vhscom opened this issue Oct 19, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@vhscom
Copy link
Contributor

vhscom commented Oct 19, 2023

Describe the bug
Given a very basic SMUI number input defined like:

<Textfield bind:value label="Quantity" type="number" input$name="quantity"/>

<script>
  import Textfield from '@smui/textfield';

  let value = '';
</script>

Pressing delete or backspace using the keyboard causes SMUI to throw:

The specified value "NaN" cannot be parsed, or is out of range.

SMUI throws at WARN level and, in this case, twice each time the value is cleared by the user.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the Different input types demo on the SMUI Text Field demo
  2. Open browser dev console and enable warning log level
  3. Locate the Number input example in the demo and clear the value using the keyboard
  4. Observe console message which is noisy and obtrusive to development workflow

Expected behavior
SMUI does not attempt to parse NaN unless the field value is explicitly set to NaN in userland.

Screenshots
Screenshot 2023-10-19 at 2 59 26 PM

Desktop (please complete the following information):

  • OS: [e.g. iOS] macos
  • Browser [e.g. chrome, safari] chromium
  • Version [e.g. 22] latest

Additional context
I believe this is related to #40 which was closed.

@vhscom vhscom added the bug Something isn't working label Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant