Skip to content

Commit

Permalink
fix(QSlider): fix odd behavior on key down when set vertical mode (fix:
Browse files Browse the repository at this point in the history
#13132) (#14385)

* test changes

* re changes

* change lambda function name

* reduce lines

* Update QSlider.js

* Update use-slider.js

* Update use-slider.js

Co-authored-by: Razvan Stoenescu <razvan.stoenescu@gmail.com>
  • Loading branch information
madosuki and rstoenescu committed Sep 14, 2022
1 parent f9983f5 commit e8d602b
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit e8d602b

Please sign in to comment.