From 5aa0b4e7d9cff57c9c22f82a937fadb5e74a5170 Mon Sep 17 00:00:00 2001 From: orangemug Date: Sun, 27 Oct 2019 11:01:33 +0000 Subject: [PATCH] More logging additional attempt at fixes. --- src/components/inputs/NumberInput.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/inputs/NumberInput.jsx b/src/components/inputs/NumberInput.jsx index ea1fba2..ab5ef25 100644 --- a/src/components/inputs/NumberInput.jsx +++ b/src/components/inputs/NumberInput.jsx @@ -93,6 +93,11 @@ class NumberInput extends React.Component { onChangeRange = (e) => { console.log(">> onChangeRange"); + if (this._cancelNextChangeEvent) { + console.log("onChangeRange:cancel"); + this._cancelNextChangeEvent = false; + return; + } const value = parseFloat(e.target.value, 10); const step = this.props.rangeStep; let dirtyValue = value; @@ -133,7 +138,12 @@ class NumberInput extends React.Component { spellCheck="false" value={rangeValue} onInput={this.onChangeRange} + onMouseUp={() => console.log("mouseup")} + onPointerDown={() => { + this._cancelNextChangeEvent = false; + }} onPointerUp={() => { + this._cancelNextChangeEvent = true; console.log(">> onPointerUp"); const {dirtyValue} = this.state; const hasChanged = this.state.props !== dirtyValue