Bundled Theme: Fix scroll jump when closing modals in Twenty Twenty.
This PR addresses an issue where closing search modal (e.g., mobile menu or search) causes the page to briefly jump to the top and scroll back. The fix ensures smooth scroll restoration by:
- Using
behavior: 'instant'inscrollTofor instant position restoration
Trac ticket: #52116
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.
Core Committers: Use this line as a base for the props when committing in SVN:
Props sainathpoojary, nikunj8866.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.
Test using WordPress Playground
The changes in this pull request can previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.
Some things to be aware of
- The Plugin and Theme Directories cannot be accessed within Playground.
- All changes will be lost when closing a tab with a Playground instance.
- All changes will be lost when refreshing the page.
- A fresh instance is created each time the link below is clicked.
- Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance, it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.
Before:
https://github.com/user-attachments/assets/935a7aca-e7f6-4476-bce4-15d6f4755b49
After:
https://github.com/user-attachments/assets/a8d5e63e-00c2-4cf0-ad80-dee538378484
== Test Report This report validates that the indicated patch addresses the issue.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/8461
=== Environment
- OS: Windows
- Web Server: Nginx
- PHP: 8.2.23
- WordPress: 6.7.2
- Browser: Chrome Version 134
- Theme: Twenty Twenty
=== Actual Results
- ✅ Issue resolved with patch.
=== Supplemental Artifacts Before Patch:
https://github.com/user-attachments/assets/ed00e54e-aed6-4974-b2b9-dfc8210bcf42
After Patch:
https://github.com/user-attachments/assets/a441d400-a200-4bf9-ac0c-f72556680d12
A commit was made that fixes the Trac ticket referenced in the description of this pull request.
SVN changeset: 60280 GitHub commit: https://github.com/WordPress/wordpress-develop/commit/91a74b3af5d54226a9af39f0685268d89f5c2d8c
This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.