Skip to content

Commit

Permalink
fix forgot to update newValue properly
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverstasa authored Oct 31, 2023
1 parent f884b7a commit d5794d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions advanced-demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const setRange = e => {
const inputText = document.querySelector('#inputs input[type="number"]');
const bar = document.querySelector('#image div');
const currentPos = getCursorPos(e);
const newValue = clamp(inputText.value*1 + (lastPos - ), 0, 100);
const newValue = clamp(inputText.value * 1 + lastPos - currentPos, 0, 100);

lastPos = currentPos;
input.value = newValue;
inputText.value = newValue;
Expand Down

0 comments on commit d5794d3

Please sign in to comment.