Skip to content

Commit

Permalink
feat: remove global focus tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
mathuo committed Oct 24, 2021
1 parent c087dc1 commit 0f85c09
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 16 deletions.
1 change: 0 additions & 1 deletion packages/dockview/src/dnd/abstractDragHandler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { getElementsByTagName } from '../dom';
import { addDisposableListener, Emitter } from '../events';
import { focusedElement } from '../focusedElement';
import { CompositeDisposable, IDisposable } from '../lifecycle';

export abstract class DragHandler extends CompositeDisposable {
Expand Down
11 changes: 0 additions & 11 deletions packages/dockview/src/focusedElement.ts

This file was deleted.

5 changes: 2 additions & 3 deletions packages/dockview/src/groupview/groupview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { ContentContainer, IContentContainer } from './panel/content';
import { ITabsContainer, TabsContainer } from './titlebar/tabsContainer';
import { IWatermarkRenderer } from './types';
import { GroupviewPanel } from './groupviewPanel';
import { focusedElement } from '../focusedElement';
import { DockviewDropTargets } from './dnd';

export enum GroupChangeKind {
Expand Down Expand Up @@ -268,11 +267,11 @@ export class Groupview extends CompositeDisposable implements IGroupview {
}

isContentFocused() {
if (!focusedElement.element) {
if (!document.activeElement) {
return false;
}
return isAncestor(
focusedElement.element,
document.activeElement,
this.contentContainer.element
);
}
Expand Down
1 change: 0 additions & 1 deletion packages/dockview/src/groupview/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { getPanelData, LocalSelectionTransfer } from '../dnd/dataTransfer';
import { getElementsByTagName, toggleClass } from '../dom';
import { IDockviewComponent } from '../dockview/dockviewComponent';
import { ITabRenderer } from './types';
import { focusedElement } from '../focusedElement';
import { IGroupPanel } from './groupPanel';
import { GroupviewPanel } from './groupviewPanel';
import { DroptargetEvent, Droptarget } from '../dnd/droptarget';
Expand Down

0 comments on commit 0f85c09

Please sign in to comment.