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

Syntax error entering spaces into number input #11710

Open
2 of 6 tasks
nwhittaker opened this issue Mar 6, 2025 · 0 comments
Open
2 of 6 tasks

Syntax error entering spaces into number input #11710

nwhittaker opened this issue Mar 6, 2025 · 0 comments
Labels
0 - new New issues that need assignment. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone needs triage Planning workflow - pending design/dev review.

Comments

@nwhittaker
Copy link
Contributor

nwhittaker commented Mar 6, 2025

Check existing issues

Actual Behavior

Given a <calcite-input-number> element, type in a number, then hit the space key with increasing frequency (timing appears to be a factor) until a period appears after the number. At this point an Uncaught SyntaxError message should appear in the console. Also the number of spaces entered trails the period until the input is next focused.

Screen.Recording.2025-03-06.at.5.06.22.PM.mov

Expected Behavior

Space keys are ignored and do not impact the value of the input.

Reproduction Sample

https://developers.arcgis.com/calcite-design-system/components/input-number/

Reproduction Steps

  1. Visit the doc page, open the devtools console.
  2. Focus the input and type in a number (in my case, 1).
  3. Rapidly hit the space key until a SyntaxError appears in the console.

Alternative reproduction steps

Programmatically setting a <calcite-input-number> element's value property to some number with a trailing space also triggers the exception.

const inputNumber = document.querySelector('calcite-input-number')
inputNumber.value = '1 '

Reproduction Version

3.0.3

Relevant Info

The . period is likely due to a platform keyboard shortcut where two spaces following a character translate to the end of a sentence.

Stack trace

Uncaught SyntaxError: Cannot convert 1   0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 to a BigInt (at DWSKOILM.js:4:288)
    at BigInt (<anonymous>)
    at new t (DWSKOILM.js:4:288)
    at T (DWSKOILM.js:4:2178)
    at DWSKOILM.js:4:2131
    at g (DWSKOILM.js:4:2488)
    at U (DWSKOILM.js:4:2047)
    at N.setNumberValue (YW6WV5X7.js:4:20681)
    at N.inputNumberInputHandler (YW6WV5X7.js:4:18051)
    at ft.handleEvent (74XIV7EB.js:6:6058)

Regression?

No response

Priority impact

impact - p2 - want for an upcoming milestone

Impact

It's an unlikely value for a user to enter, but more likely by QA for testing validation handling.

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/calcite-ui-icons
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Field Apps

@nwhittaker nwhittaker added 0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. labels Mar 6, 2025
@github-actions github-actions bot added ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone labels Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone needs triage Planning workflow - pending design/dev review.
Projects
None yet
Development

No branches or pull requests

1 participant