diff --git a/src/core/controller/controller.tooltips.js b/src/core/controller/controller.tooltips.js index 56d0003294..13e6e7e070 100644 --- a/src/core/controller/controller.tooltips.js +++ b/src/core/controller/controller.tooltips.js @@ -65,7 +65,7 @@ BI.TooltipsController = BI.inherit(BI.Controller, { }); this.showingTips = {}; if (!this.has(name)) { - this.create(name, text, level, opt.container || context); + this.create(name, text, level, opt.container || "body"); } if (!opt.belowMouse) { var offset = context.element.offset(); diff --git a/src/widget/yearmonth/__test__/combo.yearmonth.test.js b/src/widget/yearmonth/__test__/combo.yearmonth.test.js index 08684f804c..5f026b04b9 100644 --- a/src/widget/yearmonth/__test__/combo.yearmonth.test.js +++ b/src/widget/yearmonth/__test__/combo.yearmonth.test.js @@ -97,14 +97,12 @@ describe("YearMonthCombo", function () { BI.nextTick(function () { dateCombo.element.find(".bi-year-month-trigger .bi-basic-button").click(); BI.nextTick(function () { - var input = dateCombo.element.find(".bi-year-month-trigger .bi-input"); - BI.Test.triggerKeyDown(input, null, BI.KeyCode.ENTER, function () { - BI.delay(function () { - expect(dateCombo.element.find(".bi-year-month-trigger + .bi-popup-view").css("display")).to.equal("none"); - dateCombo.destroy(); - done(); - }, 300); - }); + $("body").mousedown(); + BI.delay(function () { + expect(dateCombo.element.find(".bi-year-month-trigger + .bi-popup-view").css("display")).to.equal("none"); + dateCombo.destroy(); + done(); + }, 300); }) }); }); diff --git a/src/widget/yearquarter/__test__/combo.yearquarter.test.js b/src/widget/yearquarter/__test__/combo.yearquarter.test.js index 656847b5ad..48555052f9 100644 --- a/src/widget/yearquarter/__test__/combo.yearquarter.test.js +++ b/src/widget/yearquarter/__test__/combo.yearquarter.test.js @@ -97,14 +97,12 @@ describe("YearQuarterCombo", function () { BI.nextTick(function () { dateCombo.element.find(".bi-year-quarter-trigger .bi-basic-button").click(); BI.nextTick(function () { - var input = dateCombo.element.find(".bi-year-quarter-trigger .bi-input"); - BI.Test.triggerKeyDown(input, null, BI.KeyCode.ENTER, function () { - BI.delay(function () { - expect(dateCombo.element.find(".bi-year-quarter-trigger + .bi-popup-view").css("display")).to.equal("none"); - dateCombo.destroy(); - done(); - }, 300); - }); + $("body").mousedown(); + BI.delay(function () { + expect(dateCombo.element.find(".bi-year-quarter-trigger + .bi-popup-view").css("display")).to.equal("none"); + dateCombo.destroy(); + done(); + }, 300); }) }); });