From 1a3373718f9c1a03e75b0749b0db434482ac17b7 Mon Sep 17 00:00:00 2001 From: NikolayRechkin Date: Fri, 13 Dec 2019 15:02:17 +0300 Subject: [PATCH] web: components: do not use the hover style on touch devices --- web/ASC.Web.Components/src/components/icon-button/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/ASC.Web.Components/src/components/icon-button/index.js b/web/ASC.Web.Components/src/components/icon-button/index.js index 7cdcec885a..01ade19fa1 100644 --- a/web/ASC.Web.Components/src/components/icon-button/index.js +++ b/web/ASC.Web.Components/src/components/icon-button/index.js @@ -40,7 +40,7 @@ class IconButton extends React.PureComponent { if (isDisabled) return; this.setState({ - currentIconName: iconHoverName || iconName, + currentIconName: !('ontouchstart' in document.documentElement) ? iconHoverName || iconName : iconName, currentIconColor: hoverColor || color }); @@ -71,7 +71,7 @@ class IconButton extends React.PureComponent { if (isDisabled) return; this.setState({ - currentIconName: iconClickName || iconName, + currentIconName: !('ontouchstart' in document.documentElement) ? iconClickName || iconName : iconName, currentIconColor: clickColor || color }); @@ -92,7 +92,7 @@ class IconButton extends React.PureComponent { switch (e.nativeEvent.which) { case 1: //Left click this.setState({ - currentIconName: iconHoverName || iconName, + currentIconName: !('ontouchstart' in document.documentElement) ? iconHoverName || iconName : iconName, currentIconColor: iconHoverName || color });