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

Slider: does not allow manual decimal input #3400

Closed
stevendegroote opened this issue Mar 2, 2018 · 4 comments
Closed

Slider: does not allow manual decimal input #3400

stevendegroote opened this issue Mar 2, 2018 · 4 comments
Labels
enhancement Additional functionality to current component 🐞 defect Bug...Something isn't working
Milestone

Comments

@stevendegroote
Copy link

1) Environment

  • PrimeFaces version: 6.2
  • Does it work on the newest released PrimeFaces version? Version? No
  • Affected browsers: All

2) Expected behavior

A slider that slides between decimal numbers should also allow manual input in the linked inputfield.

3) Actual behavior

Currently, the linked input field does not allow typing , or . , but only accepts 0-9

4) Steps to reproduce

Go to https://www.primefaces.org/showcase/ui/input/slider.xhtml
Second example: Slider with decimal values
Try to enter 4.5 in the input field. The . is ignored when typing.

5) Sample XHTML

https://www.primefaces.org/showcase/ui/input/slider.xhtml

6) Sample bean

https://www.primefaces.org/showcase/ui/input/slider.xhtml

@cnsgithub
Copy link
Contributor

cnsgithub commented Mar 2, 2018

If you copy+paste a decimal value like -234.5 it even accepts invalid values outside the range.

image

See #3282 what should be done on server side should probably also be done on js side so that the user cannot enter values outside the range

Enhancement? This should be a 'Defect'

@tandraschko tandraschko changed the title Decimalvalue slider does not allow manual decimal input Slider: does not allow manual decimal input Mar 2, 2018
@tandraschko tandraschko added the enhancement Additional functionality to current component label Mar 2, 2018
@tandraschko
Copy link
Member

A PR is welcome here ;)

@thiagosena
Copy link

There is still a bug when using ajax with decimal values, this bug occurs in line 53 of file SliderTemplate.java

tandraschko added a commit that referenced this issue Mar 8, 2018
@tandraschko tandraschko added the 🐞 defect Bug...Something isn't working label Mar 8, 2018
tandraschko added a commit that referenced this issue Mar 8, 2018
@tandraschko
Copy link
Member

basically it works now BUT its not perfect and a range check e.g. should be implemented.

@tandraschko tandraschko added this to the 6.3 milestone Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Additional functionality to current component 🐞 defect Bug...Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants