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 (Range) Question #9023

Open
mikeamelin opened this issue Nov 8, 2024 · 10 comments
Open

Slider (Range) Question #9023

mikeamelin opened this issue Nov 8, 2024 · 10 comments
Assignees

Comments

@mikeamelin
Copy link

mikeamelin commented Nov 8, 2024

https://www.figma.com/design/jcuAUsN02n2yJerx39mqf9/LBR--%3E-Library-Preview?node-id=2650-4443

Image

@mikeamelin mikeamelin self-assigned this Nov 8, 2024
@JaneSjs JaneSjs added the v2.0+ label Nov 8, 2024
@dmitry-kurmanov dmitry-kurmanov changed the title Slider Question Slider (Range) Question Mar 12, 2025
@JaneSjs
Copy link
Contributor

JaneSjs commented Mar 12, 2025

User Inquiries

Slider

Image

I'm trying to implement dynamic CSS changes to sliders in SurveyJS based on certain events/thresholds, similar to this example using vanilla NoUISlider: https://jsfiddle.net/myriachi/ye94zuan/346/
In the NoUISlider example, the slider handle track change color when response start/ends ( can be customized in any other event callbacks).


Range Selector

Image

@tsv2013
Copy link
Member

tsv2013 commented Mar 13, 2025

@tsv2013
Copy link
Member

tsv2013 commented Mar 13, 2025

@ElenaGorbatkova
Copy link
Member

  1. sliderType - select between line (defaut) and range
  2. enableStartValue - dispays default initial position
  3. startPosition - accept numerical values for the initial position(s)
  4. minValue - min value that can be selected
  5. maxValue - max value that can be selected
  6. stepValue - sets the value for each slider section
    or
    numberOfStatements/sections - set the number of slider sections within the given range
  7. showExtremeValues - displays the min/max values
  8. showSelectedValue - displays selected value
  9. valueType - %,number,currency
  10. decimal - 0, 0.1, etc.
  11. allowNegativeValues

@tsv2013
Copy link
Member

tsv2013 commented Mar 13, 2025

We decided to make a spike solution for a slider/range selector with the following features:

  • Support for discrete and continuous scales (from 0 to 10 000 000), on a discrete scale the thumb should snap to the nearest discrete value
  • Support for 1 (regular slider) and 2 (range slider) thumbs
  • Scale ticks can be generated automatically or specified manually, in which case they should support custom labels
  • Support for setting a step size or total tick count
  • Min/max values should be set, can be hidden on the scale
  • Ability to set min/max values dynamically using expressions
  • Support for default values
  • Support for indeterminate state (undefined value)
  • Ability to specify the min/max length of a selected range
  • Ability to hide scale labels
  • Ability to display value in a thumb's tooltip
  • Ability to display the tooltip permanently
  • Support for value formatting in the tooltip and scale labels (%, currency, and so on)
  • Some kind of mechanism of dealing with long custom labels on the scale

dmitry-kurmanov added a commit that referenced this issue Mar 17, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 17, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 18, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 19, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 19, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 19, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 19, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 19, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 20, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 20, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 20, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 20, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 20, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 20, 2025
@SamMousa
Copy link
Contributor

Great that you're working on this! This will finally allow us to drop noUISlider dependency.

@dmitry-kurmanov
Copy link
Member

Great that you're working on this! This will finally allow us to drop noUISlider dependency.

yes, exactly!

dmitry-kurmanov added a commit that referenced this issue Mar 22, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 22, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 22, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 22, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 22, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 22, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 22, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 22, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 23, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 23, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 23, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 24, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 24, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 24, 2025
dmitry-kurmanov added a commit that referenced this issue Mar 24, 2025
@dmitry-kurmanov
Copy link
Member

dmitry-kurmanov commented Mar 25, 2025

Known Issues:

  • isDiscreteValueByStep mode shouldn't allow to break the step (fisrt, last, minRange, maxRange)
    Image
  • case when default value breaks minRange/maxRange

dmitry-kurmanov added a commit that referenced this issue Mar 25, 2025
@SamMousa
Copy link
Contributor

Can we make sure not to have these boolean configuration options like isDiscreteValueByStep that have a lot of interdependencies, they always come back to haunt you later.
Why not have a mode that allows more values?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants