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

fix(QSlider): fix odd behavior on key down when set vertical mode (fix: #13132) #14385

Merged
merged 10 commits into from
Sep 14, 2022
6 changes: 5 additions & 1 deletion ui/src/components/slider/QSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ export default createComponent({

const
stepVal = ([ 34, 33 ].includes(evt.keyCode) ? 10 : 1) * state.step.value,
offset = ([ 34, 37, 40 ].includes(evt.keyCode) ? -1 : 1) * (state.isReversed.value === true ? -1 : 1) * stepVal
offset = (
([ 34, 37, 40 ].includes(evt.keyCode) ? -1 : 1)
* (state.isReversed.value === true ? -1 : 1)
* (props.vertical === true ? -1 : 1) * stepVal
)

model.value = between(
parseFloat((model.value + offset).toFixed(state.decimals.value)),
Expand Down