GithubHelp home page GithubHelp logo

Comments (10)

bombsite avatar bombsite commented on May 17, 2024 1

This would be extremely useful to have!
In addition to the previous, next, close and done; would it make sense to also have one for when the user decides to prematurely terminate the driver by clicking away? Possibly return the step that it was on when the termination occurred?

from driver.js.

alappe avatar alappe commented on May 17, 2024

I'd love to see this – ideally with the ability to block even the selection of the next step, so one could (more easily) drive js client apps with async operations creating the elements for the next step.

from driver.js.

moghya avatar moghya commented on May 17, 2024

different callback for every time next is called?

from driver.js.

alappe avatar alappe commented on May 17, 2024

That would be perfect for some scenarios of mine, yes.

To illustrate with pseudocode:

driver.defineSteps([
  {
    element: '#first-element-introduction',
    popover: {
      title: 'Welcome',
      description: 'we take you on a journey…',
      position: 'left'
    }
  }, {
    element: '#second-element-introduction',
    pre: (next) => {
      // Do some ajax calls, create nodes from results, whatever…
      const n = document.createElement('div');
      n.id = 'second-element-introduction';
      next();
    },
    popover: {
      title: 'Behold',
      description: 'the mighty div in its natural habitat…',
      position: 'right'
    }
  }
]);

As far as I played with the code for now, it seems that the selection of the elements is done on the defineSteps() call, so if an element doesn't exist at this point of time, the step fails later on. For the code above it would be necessary to select the element when the functions callback is called.

My issue could also be solved with the request of @thomasthiebaud if I understand it correctly, leading to something like:

driver.defineSteps([
  {
    element: '#first-element-introduction',
    popover: {
      title: 'Welcome',
      description: 'we take you on a journey…',
      position: 'left'
    },
    onNext: (done) => {
      // Do some ajax calls, create nodes from results, whatever…
      const n = document.createElement('div');
      n.id = 'second-element-introduction';
      done();
    }
  }, {
    element: '#second-element-introduction',
    popover: {
      title: 'Behold',
      description: 'the mighty div in its natural habitat…',
      position: 'left'
    }
  }
]);

from driver.js.

jawn-ha avatar jawn-ha commented on May 17, 2024

That would be perfect for some scenarios of mine, yes.

To illustrate with pseudocode:

driver.defineSteps([
  {
    element: '#first-element-introduction',
    popover: {
      title: 'Welcome',
      description: 'we take you on a journey…',
      position: 'left'
    }
  }, {
    element: '#second-element-introduction',
    pre: (next) => {
      // Do some ajax calls, create nodes from results, whatever…
      const n = document.createElement('div');
      n.id = 'second-element-introduction';
      next();
    },
    popover: {
      title: 'Behold',
      description: 'the mighty div in its natural habitat…',
      position: 'right'
    }
  }
]);

As far as I played with the code for now, it seems that the selection of the elements is done on the defineSteps() call, so if an element doesn't exist at this point of time, the step fails later on. For the code above it would be necessary to select the element when the functions callback is called.

My issue could also be solved with the request of @thomasthiebaud if I understand it correctly, leading to something like:

driver.defineSteps([
  {
    element: '#first-element-introduction',
    popover: {
      title: 'Welcome',
      description: 'we take you on a journey…',
      position: 'left'
    },
    onNext: (done) => {
      // Do some ajax calls, create nodes from results, whatever…
      const n = document.createElement('div');
      n.id = 'second-element-introduction';
      done();
    }
  }, {
    element: '#second-element-introduction',
    popover: {
      title: 'Behold',
      description: 'the mighty div in its natural habitat…',
      position: 'left'
    }
  }
]);

Hi, Did you solve? I have same problem

from driver.js.

Naren-hybreeder avatar Naren-hybreeder commented on May 17, 2024

@thomasthiebaud

Have you found the solution?

from driver.js.

thomasthiebaud avatar thomasthiebaud commented on May 17, 2024

No, I used something else. Maybe newer versions support it

from driver.js.

Naren-hybreeder avatar Naren-hybreeder commented on May 17, 2024

@thomasthiebaud
Thanks for the response, So many attempts, I have found the solution, My issue was, I have to call one function after clicking on the Done button.

Will share the solution here soon...

from driver.js.

kamranahmedse avatar kamranahmedse commented on May 17, 2024

We just released v1.0 of driver.js which has been rewritten from the ground up. There are more simplified hooks which give you more control over the popover and the whole lifecycle. Please have a look at the docs and do let me know if you face any issues.

from driver.js.

gowebez-ajay avatar gowebez-ajay commented on May 17, 2024

Hi @thomasthiebaud ,
i have a same problem for that done Button. Could you please share your solution may be its helpful.

from driver.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.