-
Notifications
You must be signed in to change notification settings - Fork 113
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(theme): dark and light AppStore menu fix #198
fix(theme): dark and light AppStore menu fix #198
Conversation
|
Someone is attempting to deploy a commit to a Personal Account owned by @rohit-gohri on Vercel. @rohit-gohri first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@oil-oil @srweeks @birkmose does the change fix the issue you've described? You can look at it from the preview: https://redocusaurus-git-fork-mauris-fix-store-menu-problem-rohit-gohri.vercel.app/ |
it does, nice. Noticing that switching between themes no longer maintains the selection though |
@mauris doesn't seem to fix the menu expansion issue no :( |
and to fix theme switch / on first load issues
added more changes that should address issues raised by @birkmose and @srweeks about switching themes and "not expanding menu sometimes" Thanks fellow collaborators for taking a look. the key issue was that, in What I've done in the last commit, was to simply store the current singleton instance outside of the hook, and make sure to clean up the current instance of I've also added |
That's a good solution but that will break with multiple instance of Redoc are on a single page which is possible when using the MDX components to render schemas like here: https://redocusaurus.vercel.app/docs/guides/schema-imports I'm not sure what the solution is, but this approach is definitely in the right direction and fixing some of the "hacks" I had added before. Maybe I should separate the hooks for the MDX embeds and full page docs? |
tested is it possible to update the preview? @rohit-gohri thanks! |
Thanks @rohit-gohri, the preview deployment succeeded and I can see the issues described by @birkmose and @srweeks were resolved. |
These changes look good to me, I will be merging it to a temporary branch to verify the percy snapshot tests to catch any visual regressions. And then release if all goes well |
Released in v1.1.3! Thank you for this fix! |
Fixes #172
Fixes #173
Fixes #169
Hi @rohit-gohri, thanks for this amazing plugin. I noticed the issues described in those issues filed and am proposing a fix.
The issue was because we are initiating 2 copies of
AppStore
: one for dark and one for light. The last copy ofAppStore
successfully binds various scroll events to the window and hence was the only one able to receive the event. When in light theme, this doesn't work. I understood from the code that the 2 copies ofAppStore
were meant forServerStyles
to generate the dark and light stylesheets correctly.I propose to only initiate 1 copy of
AppStore
and depending on the theme, update theoptions
accordingly.Feel free to clarify on the changes proposed. If this is alright, I'd like this fix to be published as soon as possible.