-
Notifications
You must be signed in to change notification settings - Fork 818
My Jetpack: Fix onboarding slider shift on window resize #43510
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
My Jetpack: Fix onboarding slider shift on window resize #43510
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
This is a very innovative way to use keys, but using changing width as a key doesn't seem right to me. Introducing it to all If this can't be avoided, passing this type of |
Thank you @grzegorz-cp for raising those concerns. I explained the reason for this issue in the PR description.
The width will change only when the window resizes and that is exactly when we want the UI to reflect the changes.
That won't solve this issue and throttling is already in place.
Conclusion: It's a perfectly valid usage and most of the time, that |
Ah right, of course Thanks 👍 |
Fixes MYJP-111
@keoshi noticed that the My Jetpack onboarding carousel slides shift slightly when the browser window is resized.
Screen.Recording.2025-05-01.at.14.27.13.mov
The reason for the issue is that the container width in
Swipeable
component is stale for a moment when the window is resized and is not immediately applied to the slide, which is used by theDotPager
component.Proposed changes:
Swipeable
component local state when the window is resized by using an underrated feature of React - Resetting state with a keyOther information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
jetpack docker wp jetpack disconnect blog
Screen.Recording.2025-05-19.at.1.20.48.PM.mov
Screen.Recording.2025-05-19.at.1.21.52.PM.mov