From d5ef412300600ccae15dbb66de3e35ee27a610fe Mon Sep 17 00:00:00 2001 From: orangemug Date: Sun, 19 Jan 2020 11:53:27 +0000 Subject: [PATCH] Safari fixes. --- src/components/inputs/NumberInput.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/inputs/NumberInput.jsx b/src/components/inputs/NumberInput.jsx index 093eacd..2be980b 100644 --- a/src/components/inputs/NumberInput.jsx +++ b/src/components/inputs/NumberInput.jsx @@ -134,7 +134,7 @@ class NumberInput extends React.Component { // Clamp between min/max value = Math.max(this.props.min, Math.min(this.props.max, value)); - this.setState({editing: true, value, dirtyValue}); + this.setState({value, dirtyValue}); this.props.onChange(value); } @@ -162,6 +162,13 @@ class NumberInput extends React.Component { onKeyDown={() => { this._keyboardEvent = true; }} + onPointerDown={() => { + this.setState({editing: true}); + }} + onPointerUp={() => { + // Safari doesn't get onBlur event + this.setState({editing: false}); + }} onBlur={() => { this.setState({editing: false}); }}