From d4f8481432a205b6d2f9874269d0b5712ef070a5 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 22 Aug 2018 09:28:47 +0200 Subject: [PATCH] fix #37129 --- src/vs/base/browser/ui/splitview/panelview.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/vs/base/browser/ui/splitview/panelview.ts b/src/vs/base/browser/ui/splitview/panelview.ts index 31ad491bac6..c5143e3007b 100644 --- a/src/vs/base/browser/ui/splitview/panelview.ts +++ b/src/vs/base/browser/ui/splitview/panelview.ts @@ -11,7 +11,7 @@ import { Event, Emitter, chain } from 'vs/base/common/event'; import { domEvent } from 'vs/base/browser/event'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode } from 'vs/base/common/keyCodes'; -import { $, append, addClass, removeClass, toggleClass, trackFocus } from 'vs/base/browser/dom'; +import { $, append, addClass, removeClass, toggleClass, trackFocus, scheduleAtNextAnimationFrame } from 'vs/base/browser/dom'; import { firstIndex } from 'vs/base/common/arrays'; import { Color, RGBA } from 'vs/base/common/color'; import { SplitView, IView } from './splitview'; @@ -386,7 +386,14 @@ export class PanelView implements IDisposable { addPanel(panel: Panel, size: number, index = this.splitview.length): void { const disposables: IDisposable[] = []; - panel.onDidChange(this.setupAnimation, this, disposables); + disposables.push( + // fix https://github.com/Microsoft/vscode/issues/37129 by delaying the listener + // for changes to animate them. lots of views cause a onDidChange during their + // initial creation and this causes the view to animate even though it shows + // for the first time. animation should only be used to indicate new elements + // are added or existing ones removed in a view that is already showing + scheduleAtNextAnimationFrame(() => panel.onDidChange(this.setupAnimation, this, disposables)) + ); const panelItem = { panel, disposable: combinedDisposable(disposables) }; this.panelItems.splice(index, 0, panelItem); -- GitLab