skip Step if node not found instead of rendering at center
See original GitHub issuecurrently default behavior is to render step vertically & horizontally center if node is not found. I’m curious to why this was chosen as default behavior. I feel if element node cant be found the step would generally have no value. I was thinking of making some change like below if certain prop(i.e skipStepsIfNotFound
or step level prop skipIfNotFound
) is passed down
...
const {skipStepsIfNotFound} = this.props
const skipIfNotFound =
typeof step.skipIfNotFound === 'boolean'
? step.skipIfNotFound
: typeof skipStepsIfNotFound === 'boolean'
? skipStepsIfNotFound
: false
const missingNodeWarning = () => {
step.selector &&
process.env.NODE_ENV === 'development' &&
console.warn(
`Can't find the DOM node '${step.selector}'. Please check the 'steps' Tour prop Array at position ${current}.`
)
}
if (node) {
const cb = () => stepCallback(node)
this.calculateNode(node, step.position, cb)
} else if (!node && skipIfNotFound) {
missingNodeWarning()
const { steps, onRequestClose } = this.props
const nextStep = current + 1
if (nextStep > steps.length - 1) {
onRequestClose()
} else {
this.gotoStep(nextStep)
}
} else {
this.setState(
setNodeState(null, this.helper.current, step.position),
stepCallback
)
missingNodeWarning()
}
...
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Skip Jenkins Pipeline Steps If Node Is Offline - Stack Overflow
I'd like this step performed if the node is online and skipped without failing the build if the node is offline. This is...
Read more >Output (Write) Nodes - Foundry Learn
The Write nodes in a script determine which views are available at render time, but the Render dialog can be used as a...
Read more >Troubleshooting Node.js Deploys - Heroku Dev Center
Your Node.js deploy failed - now what? Start with these simple steps to troubleshoot a build issue. Check the buildpack.
Read more >How to skip over an element in .map() ? - GeeksforGeeks
There are various ways to skip over an element in the map: Using if loop inside the function to be executed to add...
Read more >Automated rendering and network rendering in After Effects
Options that make sense when rendering a single render queue item are available like with the -comp flag. "-continueOnMissingFootage". Do not ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This should be the default behaviour
@s-pcode you can use the same snippet using
v2
using setSteps.Here is a working example.