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.

Swapping content in the portal closes it

See original GitHub issue

Bug Report

Describe the Bug

When you swap content in a portal, the portal closes.

How to Reproduce

  • Create a portal with a button in it. This button should be replaced when another content when clicked.
  • Click on the button, the portal closes.

CodeSandbox Link

https://codesandbox.io/s/focused-wing-xsyqq

Expected Behavior

The portal should stay opened.

Your Environment

  • OS: macOS
  • Browser: Chrome
  • Version of react-cool-portal: v1.0.20

Additional Information

I tracked down the issue, the problem is here. When this code is executed, the content is already replaced so the condition returns true. I found a workaround with a setTimeout (shown in the CodeSandbox) but I think this should be solved in the library side.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
wellyshencommented, Oct 20, 2020

@Kerumen This issue should be fixed in v1.0.22.

1reaction
Kerumencommented, Oct 20, 2020

@wellyshen Perfect this works like a charm!

Read more comments on GitHub >

github_iconTop Results From Across the Web

RHEL 8: Premature swapping with swappiness=0 while there ...
Even if memory is under pressure with swappiness=0, the inactive pagecache is swapped out instead of being reclaimed.
Read more >
Article - Swapping a Class - TeamDynamix
You can swap a class in your schedule if you have enrolled in one section and ... This is helpful when a previously...
Read more >
Failed to swap slots for Azure Web App - Error
This issue is read only, because it has been in the Closed - Fixed state for over 90 ... Swapping manually in Azure...
Read more >
Set up staging environments - Azure App Service
On your app's resource page in the portal, in the left pane, select Activity log. A swap operation appears in the log query...
Read more >
Drop or Swap Classes | California State University, Northridge
This guide explains how to drop and/or swap classes. ... CSUN Portal home page, Top Tools and right panel with Enroll in Classes...
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