intro.js icon indicating copy to clipboard operation
intro.js copied to clipboard

Bug in 'checkRight' function

Open domashno opened this issue 3 years ago • 3 comments

Description

Describe one (and only one) issue or enhancement you want to see in Intro.js (before writing any code). Update 'checkRight' function please, tooltipLayer should have style.left value!

function checkRight(targetOffset, tooltipLayerStyleLeft, tooltipOffset, windowSize, tooltipLayer) { if (targetOffset.left + tooltipLayerStyleLeft + tooltipOffset.width > windowSize.width) { // off the right side of the window tooltipLayer.style.left = "".concat(windowSize.width - tooltipOffset.width - targetOffset.left, "px"); return false; } tooltipLayer.style.left = "".concat(tooltipLayerStyleLeft, "px"); return true; }

domashno avatar Mar 16 '21 22:03 domashno

I’ve been having issues with the element going off the right side of a mobile device. Are you experiencing the same?

jaredgibb avatar Mar 27 '21 15:03 jaredgibb

yes, instead of tooltipLayer.left = "".concat(windowSize.width - tooltipOffset.width - targetOffset.left, "px"); use tooltipLayer.style.left = "".concat(windowSize.width - tooltipOffset.width - targetOffset.left, "px"); 'style' property was forgot here. also do not forget tooltipLayer.style.left = "".concat(tooltipLayerStyleLeft, "px");

https://cdnjs.cloudflare.com/ajax/libs/intro.js/3.4.0/intro.js (Line 2268)

domashno avatar Mar 27 '21 15:03 domashno

Thanks @domashno -- can you create an online demo to reproduce this bug? I'm happy to apply a fix asap.

afshinm avatar Mar 28 '21 11:03 afshinm