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(rangecontrol): fixes an infinite update loop #643

Merged
merged 1 commit into from
Oct 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(rangecontrol): fixes an infinite update loop
2xAA committed Oct 31, 2021
commit 02f54efbb8849db4ff8ce0ffbd4a1b634c3ae40e
6 changes: 5 additions & 1 deletion src/components/Controls/RangeControl.vue
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
:step="step"
@keypress.enter="toggleEditMode"
@click.right="toggleEditMode"
@input="numberInputHandler"
v-show="editMode"
ref="input"
/>
@@ -297,6 +298,10 @@ export default {
requestAnimationFrame(this.draw);
},

numberInputHandler() {
this.$emit("input", this.inputValue);
},

toggleEditMode(e) {
e.preventDefault();
this.editMode = !this.editMode;
@@ -367,7 +372,6 @@ export default {

inputValue(value) {
this.position = -value * this.spacingCalc;
this.$emit("input", value);
}
}
};