From ce21514246dfc89f1178d9346769317f1fff4d05 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Sat, 1 Aug 2020 16:25:56 +0300 Subject: [PATCH] - client: check touch events for tooltips --- client/src/components/ui/Tooltip.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/components/ui/Tooltip.js b/client/src/components/ui/Tooltip.js index d5cc31e8..284a53a3 100644 --- a/client/src/components/ui/Tooltip.js +++ b/client/src/components/ui/Tooltip.js @@ -22,11 +22,13 @@ const Tooltip = ({ delayHide = HIDE_TOOLTIP_DELAY, }) => { const { t } = useTranslation(); + const touchEventsAvailable = 'ontouchstart' in window; + let triggerValue = trigger; let delayHideValue = delayHide; let delayShowValue = delayShow; - if (window.matchMedia(`(max-width: ${MEDIUM_SCREEN_SIZE}px)`).matches) { + if (window.matchMedia(`(max-width: ${MEDIUM_SCREEN_SIZE}px)`).matches || touchEventsAvailable) { triggerValue = 'click'; delayHideValue = 0; delayShowValue = 0;