question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

skip Step if node not found instead of rendering at center

See original GitHub issue

currently 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:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Param-Harrisoncommented, Feb 17, 2020

This should be the default behaviour

0reactions
elrumordelaluzcommented, Jun 23, 2022

@s-pcode you can use the same snippet using v2 using setSteps.

Here is a working example.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found