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.

setReturnFocus's previouslyActiveElement is undefined, and returning false yields "setReturnFocus did not return a node"

See original GitHub issue

Thanks for the great work on this library! Seeing two unexpected errors in setReturnFocus with focus-trap-react@8.11.2.

Code like below:

 <FocusTrap
  focusTrapOptions={{
    setReturnFocus: previouslyActiveElement => {
      console.log(typeof previouslyActiveElement) // undefined
      return false;
    },
  }}>

@stefcameron, any ideas?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
stefcameroncommented, Jun 9, 2022

Will be in v8.11.3 which will be published in ~5 minutes.

2reactions
stefcameroncommented, Jun 9, 2022

My pleasure! Yes, release will come soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

focusNode returns undefined when selecting the whole element
I was able to recreate the problem, it happens when you select a line then the one just below by stopping before the...
Read more >
focus-trap-react - Bountysource
setReturnFocus's previouslyActiveElement is undefined, and returning false yields "setReturnFocus did not return a node" $ 0. Created 6 months ago in focus-trap ...
Read more >
focus-trap demo - GitHub Pages
If initialFocus is false (or a function that returns false ), no element ... When you tab through the trap, focus does not...
Read more >
Promise returns undefined no matter how I await it? - Reddit
There's no getting it without the promise chain. That's why you have to return the chain from isSubbed. const isSubbed = () =>...
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