Changeset 259277 in webkit
- Timestamp:
- Mar 30, 2020, 8:32:05 PM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r259274 r259277 1 2020-03-30 Nikita Vasilyev <nvasilyev@apple.com> 2 3 Web Inspector: the Dock Side navigation item is automatically focused when Web Inspector is opened detached, preventing any global spacebar shortcuts from working 4 https://bugs.webkit.org/show_bug.cgi?id=209760 5 6 Reviewed by Devin Rousso. 7 8 When undocking, Web Inspector focuses on the first visible focusable element. I don't know why. 9 This patch restores the focus to the previously focused element. 10 11 * UserInterface/Base/Main.js: 12 1 13 2020-03-30 Devin Rousso <drousso@apple.com> 2 14 -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r259274 r259277 902 902 if (!WI.dockedConfigurationSupportsSplitContentBrowser() && !WI.doesCurrentTabSupportSplitContentBrowser()) 903 903 WI.hideSplitConsole(); 904 905 if (side === WI.DockConfiguration.Undocked && WI.Platform.name === "mac") { 906 // When undocking, the first visible focusable element steals focus. Undo this. 907 document.body.addEventListener("focusin", function(event) { 908 let firstFocusableElement = document.querySelector("[tabindex='0']:not(.hidden)"); 909 if (firstFocusableElement === event.target) { 910 if (WI.previousFocusElement) 911 WI.previousFocusElement.focus(); 912 else 913 event.target.blur(); 914 } 915 }, {once: true, capture: true}); 916 } 904 917 }; 905 918
Note:
See TracChangeset
for help on using the changeset viewer.