question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Slider conflicted validation when non-numerical is entered

See original GitHub issue

Package

carbon-components, carbon-components-react

Browser

Firefox

Package version

10.56.0

React version

17.0.2

Description

When the props.invalid is provided to the component, it seems to be overriding the internal validation by Slider. In Chrome, this seems to be fine, since it prevents user from entering non-numerics to the text input. However, when in Firefox, it’s still allowed to enter alphabetical characters. The internal validation logic will catch this error - in the storybook, it will highlight with red border on the input box. But when we provide external validation, it fails to validate, because props.onChange is not called when the input value is not valid (alphabetics), thus it never reaches to external validation logic. Neither user nor application have a way to capture such error.

CodeSandbox example

https://codesandbox.io/s/slider-bugs-forked-6vtp9c?file=/src/index.js:307-313

Steps to reproduce

  • use Firefox, enter string “abc” into input box
  • move focus away
  • the input box is not highlighted with red border.

Code of Conduct

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nelsonchen90commented, Apr 8, 2022

@tay1orjones thanks for the analysis.

A prop could be added to facilitate onKeyUp on the Slider’s input element though

Are you proposing a new prop onKeyUp for Sliders? assuming it will be called with the current value in the input element, I think it will work for our use case.

0reactions
nelsonchen90commented, Jun 14, 2022

@tay1orjones by any chance this would be available to v7 of carbon component react (https://v10-react.carbondesignsystem.com/)

Read more comments on GitHub >

github_iconTop Results From Across the Web

REDCap-Changelog_9.2.1.docx
Major bug fix: If a slider field on a data entry form has a value set, ... employ the field validation if a...
Read more >
REDCap Change Log - Eastern Virginia Medical School
Bug fix: The "Phone (North America)" field validation might not correctly recognize some valid 10-digit North American phone numbers, especially if the fourth ......
Read more >
Known Bug List - Claris Community - FileMaker Pro
Entering a non numeric wild card such as * in a field with numeric only validation trigger's a validation error message. Validation active...
Read more >
Version 6.10.11 - (released 3/18/2016) - Harvard University
Bug fix: If a user enters data on a repeating instrument but fails to enter a ... have "number" or "integer" validation or...
Read more >
Natural System Error Messages 6900-6949
The USING operand conflicts with the specified action. - One of the values specified in ... A non-numeric character was entered as part...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found