bootstrap-tour icon indicating copy to clipboard operation
bootstrap-tour copied to clipboard

Each step in the tour is being called multiple times on page scroll

Open sidco0014 opened this issue 7 years ago • 7 comments

Hi I just did my tour set up and its running fine, the bug what I faced in the debug mode is that, when the page loads and tour steps pop's up, each tour-step is being called multiple times on scrolling the mouse causing the popup to flicker. Any idea why? I shall post my code for the tour

<script>

    var tour = new Tour({
         storage: false,
         backdrop:true,
         debug: true
    });

    tour.addSteps([{
    element: "#prediction-question-text",
    title: "Prediction Question",
    content: "Question displayed to the user to predict"}, {

    element: "#prediction-confidence",
    title: "Prediction",
    content: "Text box to give your prediction "},{

    element: "#prediction-reasoning",
    title: "Reasoning box",
    content: "Reasoning box to support your prediction"}, {

    element: "#anchor-response",
    title: "Anchor reasoning",
    content: "Reasoning by some previous player",
    placement: "auto"}, {

    element: "#prediction-anchor-value",
    title: "Anchor response",
    content: "Prediction by some previous player"}, {

    element: "#game-points",
    title: "Points",
    content: "Total points earned and points associated with that question",
    placement: "left"}, {

    element: "#additional-questions",
    title: "Additional Questions",
    content: "Additional questions to be answered regarding the question",
    placement: "left"},{

    //Dummy step to redirect to '/iarpa/user' after the last popup is shown
    element: "#additional-questions",
    title: "Additional Questions",
    content: "Additional questions to be answered regarding the question",
    placement: "left",
    path: "/iarpa/user"}

    ]);

     tour.init();
     tour.setCurrentStep(0);
     tour.start();

</script>

sidco0014 avatar Dec 27 '17 05:12 sidco0014

Having the same issue.

elmofromok avatar Jan 03 '18 15:01 elmofromok

I found that by removing the call back on line 840, the flicker goes away.

Replace this: this._onScroll((function(_this) { return function() { return _this._showPopoverAndOverlay(_this._current); };

with this: this._onScroll();

elmofromok avatar Jan 03 '18 21:01 elmofromok

Okay will do. Thanks

sidco0014 avatar Jan 05 '18 02:01 sidco0014

This indeed solves the issue, but this means that if you have an item that has scroll, the element won't scroll with it

atlanteh avatar Mar 18 '18 07:03 atlanteh

atlanteh, I fixed this scroll issue in my fork but maybe I've missed something. What do you mean by "an item that has scroll"? If you correctly attach the tour step to the (position) of an element, what scenario requires the popover to move?

@IGreatlyDislikeJavascript man that was 6 months ago. I don't eve remember what I ate last night 🤣

atlanteh avatar Nov 29 '18 11:11 atlanteh

There is an other ticket about this with a useful workaround: #658

Tour.prototype._onScroll = () => {}

MegaChriz avatar Feb 18 '19 15:02 MegaChriz