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

QRange snaps to integer on dragRange, even if step is 0 #16700

Closed
rotu opened this issue Dec 13, 2023 · 2 comments
Closed

QRange snaps to integer on dragRange, even if step is 0 #16700

rotu opened this issue Dec 13, 2023 · 2 comments
Assignees
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

@rotu
Copy link
Contributor

rotu commented Dec 13, 2023

What happened?

Dragging a range with step=0 quantizes the endpoints to integer values.
video

What did you expect to happen?

Dragging a range should drag smoothly if step=0 or snap=false.

Reproduction URL

https://codepen.io/rotu-the-bold/pen/eYxajBg

How to reproduce?

  1. Go to the provided link.
  2. Drag the midpoint

Flavour

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

Areas

Components (quasar)

Platforms/Browsers

Firefox, Chrome

Quasar info output

No response

Relevant log output

No response

Additional context

No response

@rotu rotu added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Dec 13, 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 Dec 13, 2023
@rotu
Copy link
Contributor Author

rotu commented Dec 13, 2023

I think it's related to a couple places in QRange.js where we call parseFloat((/*...*/).toFixed(state.decimals.value))

pos = {
minR,
maxR: minR + dragging.rangeRatio,
min: parseFloat(min.toFixed(state.decimals.value)),
max: parseFloat((min + dragging.rangeValue).toFixed(state.decimals.value))
}

I don't quite understand the role state.decimals plays, especially since step may be an integer. I suspect it's to prevent floating point rounding errors. If so, I think the step should be based on min and max as well so that e.g. min=0.5, max=2.5, step=1 and min=5, max=25, step=10 behave analogously.

@rstoenescu rstoenescu self-assigned this Dec 15, 2023
rstoenescu added a commit that referenced this issue Dec 18, 2023
@rstoenescu
Copy link
Member

Thanks for reporting!
Fix will be available in Quasar v2.14.2

pdanpdan added a commit to pdanpdan/quasar that referenced this issue Dec 18, 2023
…t & QRange snaps to integer on dragRange (backport from Qv2) quasarframework#16700
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
Development

No branches or pull requests

2 participants