Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: closing modal through ide url panel #316

Conversation

kewinzaq1
Copy link
Collaborator

@kewinzaq1 kewinzaq1 commented May 28, 2024

The problem:

Currently, navigating to another page is impossible if a modal is opened. The root cause of the problem is using router.push that does not dismiss modals. You can read more about it.
expo/expo#26922 (comment) .
However approaches that they proposed aren't good because they introduce other bugs such as unnecessarily closing modals, because of this - thanks to @kmagiera catch (#204 (comment)) I eventually bet on navigate combined with setParams. This approach works smoothly without introducing additional problems.

Before:

Screen_Recording_2024-05-03_at_11.54.50.mov

By replacing the current implementation with navigate and setParams we can eliminate the problem.

After:

now.mov

Copy link

vercel bot commented May 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2024 3:52pm

@kewinzaq1 kewinzaq1 changed the title Fix--closing-modal-when-navigating-through-ide-panel fix: closing modal through ide url panel May 28, 2024
Copy link
Member

@kmagiera kmagiera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sending this. It looks ok, however I think it'd be easier to just add the same code in both v2 and v3 implementation rather than extracting it out. There is already some code duplication and we aim to have as few runtime files as possible. On top of that we will likely phase out v2 implementation so it wouldn't make any sense once we only have one in place.

@kmagiera kmagiera merged commit a39adec into software-mansion:main Jun 3, 2024
2 checks passed
@kmagiera
Copy link
Member

kmagiera commented Jun 3, 2024

Thanks for this, it will go out in the next update

@kewinzaq1 kewinzaq1 deleted the fix--closing-modal-when-navigating-through-ide-panel branch June 3, 2024 10:05
kmagiera added a commit that referenced this pull request Jun 12, 2024
In #316 we introduced a regression with expo-router v2 integration. The
used `router.navigate` method is only available in v3 and hence we
revert that modification change for expo-router v2 plugin. This PR
effectively reverts changes from #316 made to
packages/vscode-extension/lib/expo_router_v2_plugin.js file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants