Skip to content

Commit dd5fb7c

Browse files
bmeurerDevtools-frontend LUCI CQ
authored andcommitted
[cleanup] Remove confusing/unnecessary savedFocus logic.
The `DockController` has some confusing logic to supposedly restore focus when the dock position changes, but this isn't necessary, since keyboard focus state is anyways maintained by Blink. Fixed: 400893458 Change-Id: I098d23df6c9c2f8105a08958d014054c9499af64 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6330289 Reviewed-by: Alex Rudenko <[email protected]> Auto-Submit: Benedikt Meurer <[email protected]> Commit-Queue: Alex Rudenko <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]>
1 parent f03d449 commit dd5fb7c

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

front_end/ui/legacy/DockController.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import * as Common from '../../core/common/common.js';
3232
import * as Host from '../../core/host/host.js';
3333
import * as i18n from '../../core/i18n/i18n.js';
34-
import * as Platform from '../../core/platform/platform.js';
3534
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
3635

3736
import type {ActionDelegate} from './ActionRegistration.js';
@@ -81,7 +80,6 @@ export class DockController extends Common.ObjectWrapper.ObjectWrapper<EventType
8180
private readonly lastDockStateSetting: Common.Settings.Setting<DockState>;
8281
private dockSideInternal: DockState|undefined = undefined;
8382
private titles?: Common.UIString.LocalizedString[];
84-
private savedFocus?: Element|null;
8583

8684
constructor(canDock: boolean) {
8785
super();
@@ -175,7 +173,6 @@ export class DockController extends Common.ObjectWrapper.ObjectWrapper<EventType
175173
this.lastDockStateSetting.set(this.dockSideInternal);
176174
}
177175

178-
this.savedFocus = Platform.DOMUtilities.deepActiveElement(document);
179176
const eventData = {from: this.dockSideInternal, to: dockSide};
180177
this.dispatchEventToListeners(Events.BEFORE_DOCK_SIDE_CHANGED, eventData);
181178
console.timeStamp('DockController.setIsDocked');
@@ -189,10 +186,6 @@ export class DockController extends Common.ObjectWrapper.ObjectWrapper<EventType
189186

190187
private setIsDockedResponse(eventData: ChangeEvent): void {
191188
this.dispatchEventToListeners(Events.AFTER_DOCK_SIDE_CHANGED, eventData);
192-
if (this.savedFocus) {
193-
(this.savedFocus as HTMLElement).focus();
194-
this.savedFocus = null;
195-
}
196189
}
197190

198191
toggleDockSide(): void {

0 commit comments

Comments
 (0)