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

p-slider: Entering a decimal value without a preceding number before decimal point gives error #11790

Closed
vinnyab28 opened this issue Aug 7, 2022 · 3 comments · Fixed by #11810
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@vinnyab28
Copy link
Contributor

vinnyab28 commented Aug 7, 2022

Describe the bug

When an input box is mapped to the p-slider and when the step value is a decimal number, the number entered in the input box without a preceding number before the decimal such as .5 or .32 and change the slider after inputting the value and it throws an error during number conversion.

Environment

Angular CLI: 14.0.7
Node: 16.16.0
Package Manager: npm 8.16.0
OS: darwin x64

Reproducer

No response

Angular version

14.0.7

PrimeNG version

14.0.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

16.6.0

Browser(s)

No response

Steps to reproduce the behavior

  1. Add a p-slider element in your application with a template reference #slider
  2. Add a p-inputtext element in your application.
  3. Connect the input box with the slider either by using [(ngModel)] or formControlName.
  4. Set the p-slider attributes [step]="0.1" [max]="1" [min]="0".
  5. Enter value .2 in the input box.
  6. Move the slider with .2 in the input box.

Expected behavior

Value .2 to be converted to 0.2 instead of throwing an error

@vinnyab28 vinnyab28 added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Aug 7, 2022
@cetincakiroglu cetincakiroglu added Resolution: Cannot Replicate Issue could not be replicated by Core Team and removed Type: Bug Issue contains a bug related to a specific component. Something about the component is not working labels Aug 8, 2022
@cetincakiroglu
Copy link
Contributor

Hi,

Cannot replicate the issue please feel free to re-open with a StackBlitz example.

@vinnyab28
Copy link
Contributor Author

Hi,

Cannot replicate the issue please feel free to re-open with a StackBlitz example.

Kindly find the Stackblitz Example here with steps to reproduce. Reopen this if this is appropriate.

@cetincakiroglu
Copy link
Contributor

Hi,

Thanks for sharing reproducer

@cetincakiroglu cetincakiroglu added this to the 14.0.3 milestone Sep 9, 2022
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Resolution: Cannot Replicate Issue could not be replicated by Core Team labels Sep 9, 2022
@cetincakiroglu cetincakiroglu linked a pull request Sep 9, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants