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

preferences: fix 'number' input validation #9089

Merged
merged 1 commit into from
Feb 23, 2021

Conversation

vince-fugnitto
Copy link
Member

What it does

The following pull-request fixes the validation logic for numeric preference inputs part of the preferences-view.
Previously, the logic would return false negatives for users attempting to input 0 as a valid preference value. The logic was updated to properly validate numeric input fields, and accept 0 when it is possible.

Master:

master-pref.mov

Pull-Request:

pr-pref.mov

How to test

  1. start the application, and open the preferences-ui
  2. search for editor.fastScollSensitivity (the preference was used since it should accept 0 as a value)
  3. remove the value - an error message should appear
  4. input 0 - it should be accepted without an error message and remain in the input after onBlur or focus is lost

Review checklist

Reminder for reviewers

Signed-off-by: vince-fugnitto vincent.fugnitto@ericsson.com

@vince-fugnitto vince-fugnitto added bug bugs found in the application preferences issues related to preferences labels Feb 18, 2021
@vince-fugnitto vince-fugnitto force-pushed the vf/numeric-validator branch 2 times, most recently from 7f85aef to 4adc1a3 Compare February 19, 2021 17:54
The following commit fixes the validation for `number` type inputs in
the preferences-ui which resulted in false negatives when users
attempted to input `0` as a valid value.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
Copy link
Member

@paul-marechal paul-marechal left a comment

Choose a reason for hiding this comment

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

LGTM!

@vince-fugnitto vince-fugnitto merged commit 2681e6e into master Feb 23, 2021
@vince-fugnitto vince-fugnitto deleted the vf/numeric-validator branch February 23, 2021 19:04
@github-actions github-actions bot added this to the 1.11.0 milestone Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application preferences issues related to preferences
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants