Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/features/ParameterHintsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ define(function (require, exports, module) {
*
*/
function dismissHint(editor) {
popupShown = false;
if (hintState.visible) {
$hintContainer.hide();
$hintContent.empty();
hintState = {};
popupShown = false;

if (editor) {
editor.off("cursorActivity.ParameterHinting", handleCursorActivity);
Expand Down
3 changes: 2 additions & 1 deletion src/view/WorkspaceManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,8 @@ define(function (require, exports, module) {
// handled by the inline widget itself first.
return;
}
if(focussedEditor.canConsumeEscapeKeyEvent()){
const dropdownOpen = $(".dropdown.open").is(":visible");
if(dropdownOpen || focussedEditor.canConsumeEscapeKeyEvent()){
return;
}

Expand Down
24 changes: 23 additions & 1 deletion test/spec/MainViewManager-integ-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
*/

/*global describe, beforeEach, beforeAll, afterAll, afterEach, it, expect, awaitsForDone, spyOn, jasmine, Phoenix */
/*global describe, beforeEach, beforeAll, afterAll, it, expect, awaitsForDone, spyOn, jasmine, awaitsFor */

define(function (require, exports, module) {

Expand Down Expand Up @@ -1009,6 +1009,28 @@ define(function (require, exports, module) {
expect(WorkspaceManager.removeEscapeKeyEventHandler("x")).toBeTrue();
});

it("should not dismiss any panel if codehints are visible", async function () {
panel1.show();
panel2.hide();
expect(panel1.isVisible()).toBeTrue();

expect(MainViewManager.getActivePaneId()).toEqual("first-pane");
promise = MainViewManager._open(MainViewManager.FIRST_PANE, FileSystem.getFileForPath(testPath + "/test.js"));
await awaitsForDone(promise, "MainViewManager.doOpen");
let editor = EditorManager.getActiveEditor();
editor.setCursorPos(0, 0);
await awaitsForDone(CommandManager.execute(Commands.SHOW_CODE_HINTS));
await awaitsFor(function () {
return testWindow.$(".codehint-menu").is(":visible");
}, "codehints to be shown");

SpecRunnerUtils.simulateKeyEvent(KeyEvent.DOM_VK_ESCAPE, "keydown", _$("#editor-holder")[0]);
await awaitsFor(function () {
return !testWindow.$(".codehint-menu").is(":visible");
}, "codehints to be dismissed on escape press");
expect(panel1.isVisible()).toBeTrue();
});

it("should escape close bottom panel one by one", async function () {
panel1.show();
expect(panel1.isVisible()).toBeTrue();
Expand Down
Loading