Code Monkey home page Code Monkey logo

Comments (2)

mpajarillo19 avatar mpajarillo19 commented on May 29, 2024

@kamranahmedse
// Hello, good day! How to set a stageRadius for specific steps only in one drive? The website print a console error: No steps to drive through

// Example:

// This is my global config:

const driverObj = driver({
nextBtnText: "NEXT",
doneBtnText: "DONE",
allowClose: false,
showButtons: ["next", "close"],
stagePadding: 0,
stageRadius: 1,
popoverOffset: 40,
steps: [
{
// Step 1
},
{
element: ".save",
popover: {
popoverClass: "classname-example",
title: " ",
description: `
// desc,
side: "bottom",
align: "end",
},
onHighlightStarted: () => {
driverObj.setConfig({
nextBtnText: "NEXT",
doneBtnText: "DONE",
allowClose: false,
showButtons: ["next", "close"],
stagePadding: 0,
stageRadius: 40,
popoverOffset: 40,
});
},
},
{
// Step 3
}
]
});

from driver.js.

chawkichalladia avatar chawkichalladia commented on May 29, 2024

set config sets the entire configs not just the mentioned ones. I actually struggled with this for a bit when I started using the library few days ago. They are definitely lacking in terms or atomic operations and very hard to use outside of a single approach.

do this:

const generateConfig = (config: Config) => ({ /* default configs */, ...config})

const onNext = () => {
const currentStep = driver.getActiveIndex();
driver.setConfg(generateConfig(/* updated configs here */))
driver.move(currentStep) // can also be currentStep+1 so verify when you implement
}

you can have the reverse operation after for when you leave that step. you want use the currentStep index to check what should be applied. the final drive.move might not be necessary too. this is not a real example but built from documentation and the obstacles I faced, so play around with the idea to find what works for your situation.

hope this helps.

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.