Tabs: dragging tabs around causes the cursor to flicker a lot (fixes #38753)

This commit is contained in:
Benjamin Pasero 2017-11-22 19:10:06 +01:00
parent a858ad5434
commit 018a151c9d
2 changed files with 9 additions and 0 deletions

View file

@ -51,6 +51,10 @@
will-change: transform; /* forces tab to be drawn on a separate layer (fixes https://github.com/Microsoft/vscode/issues/18733) */
}
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.dragged-over * {
pointer-events: none; /* prevents cursor flickering (fixes https://github.com/Microsoft/vscode/issues/38753) */
}
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.close-button-left {
flex-direction: row-reverse;
padding-left: 0;

View file

@ -773,6 +773,8 @@ export class TabsTitleControl extends TitleControl {
}
}
DOM.addClass(tab, 'dragged-over');
if (!draggedEditorIsTab) {
this.updateDropFeedback(tab, true, index);
}
@ -782,6 +784,7 @@ export class TabsTitleControl extends TitleControl {
disposables.push(DOM.addDisposableListener(tab, DOM.EventType.DRAG_LEAVE, (e: DragEvent) => {
counter--;
if (counter === 0) {
DOM.removeClass(tab, 'dragged-over');
this.updateDropFeedback(tab, false, index);
}
}));
@ -789,6 +792,7 @@ export class TabsTitleControl extends TitleControl {
// Drag end
disposables.push(DOM.addDisposableListener(tab, DOM.EventType.DRAG_END, (e: DragEvent) => {
counter = 0;
DOM.removeClass(tab, 'dragged-over');
this.updateDropFeedback(tab, false, index);
this.onEditorDragEnd();
@ -797,6 +801,7 @@ export class TabsTitleControl extends TitleControl {
// Drop
disposables.push(DOM.addDisposableListener(tab, DOM.EventType.DROP, (e: DragEvent) => {
counter = 0;
DOM.removeClass(tab, 'dragged-over');
this.updateDropFeedback(tab, false, index);
const { group, position } = this.toTabContext(index);