From a444eda46b6f76cd8e6070359a0ef45f34272512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20K=C3=B6n=C3=B6nen?= Date: Tue, 9 Nov 2021 00:37:26 +0200 Subject: [PATCH] Different timeout method for measurement input tooltip show --- src/common/MeasurementInput.jsx | 6 +++++- src/common/SizeForm.jsx | 2 +- src/common/SizeForm.scss | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/common/MeasurementInput.jsx b/src/common/MeasurementInput.jsx index 93e6ff8..88e0f01 100644 --- a/src/common/MeasurementInput.jsx +++ b/src/common/MeasurementInput.jsx @@ -58,6 +58,10 @@ class MeasurementInput extends React.Component { clearTimeout(this.timeout); this.timeout = null; } + if (this.tooltipTimeout) { + clearTimeout(this.tooltipTimeout); + this.tooltipTimeout = null; + } // because isBlur could be an event const blur = isBlur === true; @@ -111,7 +115,7 @@ class MeasurementInput extends React.Component { onFocus = () => { this.props.onFocus(); - ReactTooltip.show(this.tooltip); + this.tooltipTimeout = setTimeout(() => {ReactTooltip.show(this.tooltip);}, 200); }; onKeyDown = e => { diff --git a/src/common/SizeForm.jsx b/src/common/SizeForm.jsx index 5e73e94..e56616f 100644 --- a/src/common/SizeForm.jsx +++ b/src/common/SizeForm.jsx @@ -146,7 +146,7 @@ class SizeForm extends React.Component { ).orElse(null)} ))} - +