-
Couldn't load subscription status.
- Fork 60
Description
Description:
When closing DevTools in Microsoft Edge, the page unexpectedly scrolls to the top. This behavior is caused by the browser resetting focus to the first focusable element in the document, which triggers a scroll jump. This issue does not occur in Chrome under the same conditions.
Steps to Reproduce:
- Open a scrollable webpage, e.g. Google Search.
- Scroll down to the middle or bottom of the page.
- Press
F12to open DevTools. - Do not click on the page — leave focus on DevTools.
- Press
F12or click the X button to close DevTools. - The page jumps to the top.
Alternative Behavior:
If the user clicks anywhere on the page to return focus to the document before pressing F12 to close DevTools, the scroll position is preserved and no jump occurs.
Expected Behavior:
The page should retain its scroll position after DevTools is closed, regardless of focus state.
Actual Behavior:
The page scrolls to the top due to focus being reset to the first element in the document.
Why This Matters:
This disrupts user experience, especially on long-scroll pages like search results, documentation, or dashboards. It also affects developers who are debugging scroll-related behavior.
Environment:
- Browser: Microsoft Edge
- OS: Windows
- Edge Version: 140
Notes:
- Chrome does not exhibit this behavior, even when DevTools is closed without refocusing the page.