diff --git a/lib/features/search-pad/SearchPad.js b/lib/features/search-pad/SearchPad.js index 1954c7e81..94d235c71 100644 --- a/lib/features/search-pad/SearchPad.js +++ b/lib/features/search-pad/SearchPad.js @@ -336,6 +336,8 @@ SearchPad.prototype.open = function() { this._cachedSelection = this._selection.get(); this._cachedViewbox = this._canvas.viewbox(); + this._selection.select(null); + this._bindEvents(); this._open = true; diff --git a/test/spec/features/search-pad/SearchPadSpec.js b/test/spec/features/search-pad/SearchPadSpec.js index cc009ad28..c847b4c67 100644 --- a/test/spec/features/search-pad/SearchPadSpec.js +++ b/test/spec/features/search-pad/SearchPadSpec.js @@ -192,6 +192,19 @@ describe('features/search-pad', function() { })); + it('should clear selection', inject(function(searchPad, selection) { + + // given + selection.select(elements.one.a); + + // when + searchPad.open(); + + // then + expect(selection.get()).to.be.empty; + })); + + it('should error when provider not registered', inject(function(searchPad) { // given