intro.js
intro.js copied to clipboard
Bug in 'checkRight' function
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;
}
I’ve been having issues with the element going off the right side of a mobile device. Are you experiencing the same?
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)
Thanks @domashno -- can you create an online demo to reproduce this bug? I'm happy to apply a fix asap.