Comments (2)
@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.
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)
- Conflict between multiple driver instances on the same page with distinct configurations HOT 7
- Close button x to modify the issue HOT 1
- How to add a popover to a select field with the drop-down options
- How to avoid exiting when clicking on the mask HOT 2
- Driver is not a function HOT 1
- what is the canonical / suggested way to internationalize the texts?
- Title does't support HTML
- Wait until element exists? HOT 3
- is it possible to set width and height of popover at individual step level dynamically? HOT 1
- How to add image in popover HOT 1
- 'Unable to preventDefault inside passive event listener invocation.' Console Error When Hooking into Lifecycle Methods
- Purely programmatic step?
- Add onOverlayClicked callback
- Can ‘getConfig("animate")’ be replaced with ‘isAnimatedTour’ ?
- Can ‘getConfig("animate")’ be replaced with ‘isAnimatedTour’ ?
- Is there a way to make the overlay mask fixed to an element area instead of the entire body? HOT 1
- (Re) Support the feature to move next on click outside the element
- Can the position of a popover be fixed?
- Can this work with Canvas elements? HOT 2
- How can I make the popup display while the project can be clicked normally?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from driver.js.