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 work with fractional step values #1901

Closed
ProbableTrain opened this issue Mar 25, 2021 · 0 comments
Closed

Slider does not work with fractional step values #1901

ProbableTrain opened this issue Mar 25, 2021 · 0 comments
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@ProbableTrain
Copy link

There is no guarantee in receiving an immediate response in GitHub Issue Tracker, If you'd like to secure our response, you may consider PrimeReact PRO Support where support is provided within 4 business hours

I'm submitting a ... (check one with "x")

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Codesandbox Case (Bug Reports)

https://codesandbox.io/s/divider-forked-okz0j

Current behavior

  • Slider component
  • Set a fractional step value e.g. 0.25
  • In the interface, the slider does not snap to the fraction (it snaps to 1 instead)

Expected behavior

  • Set a fractional step value e.g. 0.25
  • Slide the slider - its snaps to each 0.25 increment

Minimal reproduction of the problem with instructions

https://codesandbox.io/s/divider-forked-okz0j

import "./styles.css";
import { Slider } from "primereact/slider";

import React, { useState } from "react";

export default function App() {
  const [v, setV] = useState(0);
  return (
    <div className="App card">
      <div>{v}</div>
      <Slider
        value={v}
        min={0}
        max={6.25}
        step={0.25}
        onChange={(e) => setV(e.value)}
      />
    </div>
  );
}

Please tell us about your environment:

n/a

  • React version:

17.0.1

  • PrimeReact version:

6.2.1

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Firefox and Chrome

  • Language:
    all
@mertsincan mertsincan changed the title Slider does not work with fractional step values (e.g. 0.25) Slider does not work with fractional step values Mar 26, 2021
@mertsincan mertsincan self-assigned this Mar 26, 2021
@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label Mar 26, 2021
@mertsincan mertsincan added this to the 6.2.2 milestone Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants