diff --git a/tabby-core/src/components/splitTab.component.ts b/tabby-core/src/components/splitTab.component.ts index 28bfe0e1..d3b3350f 100644 --- a/tabby-core/src/components/splitTab.component.ts +++ b/tabby-core/src/components/splitTab.component.ts @@ -158,7 +158,6 @@ export type SplitDropZoneInfo = { > 1 - } - destroy (): void { super.destroy() for (const x of this.getAllTabs()) { diff --git a/tabby-core/src/components/splitTabDropZone.component.ts b/tabby-core/src/components/splitTabDropZone.component.ts index a62bc304..138825e9 100644 --- a/tabby-core/src/components/splitTabDropZone.component.ts +++ b/tabby-core/src/components/splitTabDropZone.component.ts @@ -23,32 +23,22 @@ import { SplitDropZoneInfo } from './splitTab.component' export class SplitTabDropZoneComponent extends SelfPositioningComponent { @Input() dropZone: SplitDropZoneInfo @Input() parent: BaseTabComponent - @Input() enabled = false @Output() tabDropped = new EventEmitter() @HostBinding('class.active') isActive = false @HostBinding('class.highlighted') isHighlighted = false + // eslint-disable-next-line @typescript-eslint/no-useless-constructor constructor ( element: ElementRef, app: AppService, ) { super(element) this.subscribeUntilDestroyed(app.tabDragActive$, tab => { - this.isActive = !!(tab && this.canActivateFor(tab)) + this.isActive = !!tab && tab !== this.parent && (this.dropZone.type === 'relative' || tab !== this.dropZone.container.children[this.dropZone.position]) this.layout() }) } - canActivateFor (tab: BaseTabComponent) { - if (tab === this.parent || !this.enabled) { - return false - } - if (this.dropZone.type === 'absolute' && tab === this.dropZone.container.children[this.dropZone.position]) { - return false - } - return true - } - ngOnChanges () { this.layout() }