Skip to content

Commit

Permalink
dxFilterBuilder: Fix menu popup settings (#3034)
Browse files Browse the repository at this point in the history
  • Loading branch information
komarovalexander authored Feb 20, 2018
1 parent ce847e8 commit ef37493
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
6 changes: 2 additions & 4 deletions js/ui/filter_builder/filter_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,13 +719,12 @@ var FilterBuilder = Widget.inherit({
onHiding: function(e) {
$button.removeClass(ACTIVE_CLASS);
},
position: { my: position + " top", at: position + " bottom", offset: "0 1" },
position: { my: position + " top", at: position + " bottom", offset: "0 1", of: $button },
animation: null,
onHidden: function() {
removeMenu();
},
cssClass: FILTER_BUILDER_OVERLAY_CLASS + " " + options.menu.cssClass,
target: $button,
rtlEnabled: rtlEnabled
});

Expand All @@ -737,7 +736,7 @@ var FilterBuilder = Widget.inherit({
if((e.type === "keydown" && e.keyCode === TAB_KEY)
|| (e.type === "keyup" && (e.keyCode === ESCAPE_KEY || e.keyCode === ENTER_KEY))) {
info.component.hide();
eventsEngine.trigger(options.menu.target, "focus");
eventsEngine.trigger(options.menu.position.of, "focus");
}
});

Expand Down Expand Up @@ -1060,7 +1059,6 @@ var FilterBuilder = Widget.inherit({
$popup = $("<div>")
.addClass(options.menu.cssClass).appendTo($container);
this._createComponent($popup, Popup, {
target: options.menu.target,
onHiding: options.menu.onHiding,
onHidden: options.menu.onHidden,
rtlEnabled: options.menu.rtlEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,26 @@ QUnit.module("Rendering", function() {
//assert
assert.equal($container.find(".dx-texteditor-input").val(), "3.14 kg", 'numberbox formatted value');
});

//T603217
QUnit.test("Menu popup hasn't target", function(assert) {
// arrange
var $container = $("#container");

$container.dxFilterBuilder({
value: ["Weight", "=", 3.14],
fields: [{
dataField: "Weight",
dataType: 'number'
}]
});

// act
$("." + FILTER_BUILDER_GROUP_OPERATION_CLASS).trigger("dxclick");

// assert
assert.notOk($container.find(".dx-filterbuilder-overlay").dxPopup("instance").option("target"), "popup target shoud not be set");
});
});

QUnit.module("Filter value", function() {
Expand Down

0 comments on commit ef37493

Please sign in to comment.