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

[QSlider] Step starts from min instead of inner min, resulting in wrong stepping if using floats #16614

Closed
Tofandel opened this issue Nov 20, 2023 · 1 comment · Fixed by #16615
Labels
area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@Tofandel
Copy link
Contributor

Tofandel commented Nov 20, 2023

What happened?

The slider starts at 4$, when clicking anywhere on it, you get steps always ending with .8

What did you expect to happen?

Since innerMin is the actual minimum selectable value, the steps should be starting from that instead and be whole numbers

Reproduction URL

https://codepen.io/Tofandel/pen/NWoymZm?editors=101

How to reproduce?

  1. Go to the reproduction link
  2. Click anywhere on the slider
  3. Notice the value is x.8 $ and it doesn't match with any of the marker label steps
  4. If you click on 3, the slider caps it to inner min and stays at 3 $
  5. If you use the keyboard arrows, then you get the correct behavior

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Components (quasar)

Platforms/Browsers

Firefox, Chrome, Safari, Microsoft Edge, iOS, Android, Electron

Quasar info output

No response

Relevant log output

No response

Additional context

The issue seems to be coming from this function which uses min and max instead of innerMin and innerMax
https://github.com/quasarframework/quasar/blob/dev/ui/src/components/slider/use-slider.js#L236-L250

@Tofandel Tofandel added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Nov 20, 2023
@github-actions github-actions bot added area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite labels Nov 20, 2023
rstoenescu added a commit that referenced this issue Nov 29, 2023
…d of `min` on drag #16614 (#16615)

* Fix slider conversion

* Clamp ratio

* Update use-slider.js

---------

Co-authored-by: Razvan Stoenescu <razvan.stoenescu@gmail.com>
@rstoenescu
Copy link
Member

Fix will be available in Quasar v2.14.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
2 participants