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.

Slider: Issues with Step configuration (calculation)

See original GitHub issue

Describe the defect As I already wrote in the forum (https://forum.primefaces.org/viewtopic.php?f=3&t=71799) I think there is a little bug in the step configuration or calculation of the slider element.

For my point of view the calculation of the steps is done based on the min value instead of zero base. If you have a min value of 800 the next step is 1300 (800+500), I would expect 1000 (0 + 500 + 500). Also when the max value isn’t a value of the min value, you can not reach it. My example here is 15000 end value of the Slider with it is 14800.

Reproducer Reproducer is attached to the ticket, code sniped:

@PostConstruct  
public void init() {
    integer = 3000;
}
<h:form id="frmTest">
    <h:panelGrid columns="1" style="margin-bottom: 10px">
         <p:inputText id="number" value="#{testView.integer}" />
         <p:slider for="number" minValue="800" maxValue="15000" step="500" />
    </h:panelGrid>
</h:form>

Environment:

  • PF Version: 11.0.0
  • JSF + version: _e.g. Mojarra 2.2.20
  • Affected browsers: my test is based on Chrome, but I think all

Expected behavior My expected behavior is, that the calculation is based on zero and the first and the last point are calculated individual.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Teutron-flocommented, Apr 5, 2022

@melloware, I’m right now on it to perform a couple of tests. During that, I notice that you fix with it, also an issue in the showcase.

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

InputText Slider with Decimal Value -> Range defined from 0.2 -> 7.1 In the showcase application 7.1 is not reachable.

I added it to pf-8619 and it works: image

1reaction
Teutron-flocommented, Apr 1, 2022

Thanks for the fix. I will take a look into it on Monday. Over the Weekend i have no time for it, sorry.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Slider Design: Rules of Thumb - Nielsen Norman Group
Selecting a precise value using a slider is difficult and requires good motor skills. Do not use a slider if picking an exact...
Read more >
BPM UI toolkit: Slider control - IBM
This control creates a slider with a handle that you can drag to increase or decrease a ... Set the formula configuration properties...
Read more >
Designing The Perfect Slider - Smashing Magazine
In all of these use cases, a slider is helpful because it allows users to ... A two-step energy costs calculator helps the...
Read more >
Need a little help on an equation for a GUI "Slider"
Solved it! So my equation was a bit wrong for the adjustment. As now it looks like this: var percent = val/val_max var...
Read more >
Slider Question - Qualtrics
... Single-Instance Incentives · Frontline Feedback Task · Calculate Metric ... Step 4: Setting Up Your Messages · Step 5: Designing Your Subject...
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