diff --git a/lib/minimap-element.coffee b/lib/minimap-element.coffee index f3706fab..8df431fe 100644 --- a/lib/minimap-element.coffee +++ b/lib/minimap-element.coffee @@ -297,7 +297,11 @@ class MinimapElement extends HTMLElement @requestForcedUpdate() if @attached pollDOM: -> - @measureHeightAndWidth(false) if @isVisible() + if @isVisible() + @requestForcedUpdate() unless !@wasVisible + + @measureHeightAndWidth(false) + checkForVisibilityChange: -> if @isVisible() diff --git a/spec/minimap-element-spec.coffee b/spec/minimap-element-spec.coffee index 9510b2e8..a2278936 100644 --- a/spec/minimap-element-spec.coffee +++ b/spec/minimap-element-spec.coffee @@ -258,6 +258,15 @@ describe 'MinimapElement', -> expect(minimapElement.canvas.width).toEqual(canvasWidth) expect(minimapElement.canvas.height).toEqual(canvasHeight) + describe 'from hidden to visible', -> + beforeEach -> + spyOn(minimapElement, 'requestForcedUpdate') + editorElement.style.display = '' + minimapElement.pollDOM() + + it 'requests an update of the whole minimap', -> + expect(minimapElement.requestForcedUpdate).toHaveBeenCalled() + # ###### ###### ######## ####### ## ## # ## ## ## ## ## ## ## ## ## ## # ## ## ## ## ## ## ## ##