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

Strange behaviour of onClick navigation prop of a Button #3535

Open
prakhargupta1 opened this issue May 9, 2024 · 1 comment
Open

Strange behaviour of onClick navigation prop of a Button #3535

prakhargupta1 opened this issue May 9, 2024 · 1 comment
Labels
bug 🐛 Something doesn't work

Comments

@prakhargupta1
Copy link
Member

prakhargupta1 commented May 9, 2024

Steps to reproduce

Video from v0.1.55

Screen.Recording.2024-05-09.at.2.13.29.PM.mov

After navigating to another page, on clicking the browser back button:

  • the app goes to preview mode.
  • and back in the edit mode, the original button disappears.

Search keywords: button

@prakhargupta1 prakhargupta1 added the bug 🐛 Something doesn't work label May 9, 2024
@Janpot
Copy link
Member

Janpot commented May 21, 2024

Toolpad doesn't create history entries when switching between pages. So when you click the back button after switching a page, it goes back to wherever you were before. If you were on the preview page before, it will go back to that preview. The reason is that since undo/redo also takes into account switching views it gets too close intertwined with the back button. I don't believe we don't have as much control as we want over the history stack to really deal with the corner-cases. So switching pages is a history replace, not a history push. We could make this more intuitive by making the page name a query parameter instead, e.g. /prod/editor/app?page=myPage

Regarding the disappearing button, there seems to be going something wrong on your end when saving the project:
Screenshot 2024-05-21 at 11 40 04

This is a different issue, if you still experience this, can you create a reproduction and open a new ticket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

No branches or pull requests

2 participants