Skip to content
Snippets Groups Projects
Commit e1a5e641 authored by KDSBrowne's avatar KDSBrowne
Browse files

disable tooltips if device has touch & fits phone dimensions

parent ec74351a
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,20 @@ class Tooltip extends Component {
};
this.tooltip = Tippy(`#${this.tippySelectorId}`, options);
const MAX_PHONE_VIEWPORT = 480;
const hasPhoneDimensions = (
(window.screen.width <= MAX_PHONE_VIEWPORT && window.screen.width < window.screen.height)
||
(window.screen.height <= MAX_PHONE_VIEWPORT && window.screen.width > window.screen.height)
);
const method = (
('ontouchstart' in window || navigator.msMaxTouchPoints) && hasPhoneDimensions)
? 'disable' : 'enable';
this.tooltip.tooltips.map(tip => tip[method]());
}
onShow() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment