Skip to content

Commit df1a097

Browse files
Popup: template wrapper element inherits maxHeight and minHeight styles from parent when popup dimensions are auto (T1259619) (DevExpress#28728)
1 parent 67dac66 commit df1a097

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

packages/devextreme-scss/scss/widgets/base/_popup.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
.dx-popup-inherit-height & {
8383
@include dx-popup-content-auto-resizing();
8484

85-
> .dx-template-wrapper {
85+
> div {
8686
max-height: inherit;
8787
min-height: inherit;
8888

packages/devextreme/testing/tests/DevExpress.ui.widgets/popup.tests.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,26 @@ QUnit.module('options changed callbacks', {
10731073
assert.ok($popup.hasClass(POPUP_CONTENT_INHERIT_HEIGHT_CLASS), 'has POPUP_CONTENT_INHERIT_HEIGHT_CLASS with auto width');
10741074
});
10751075

1076+
QUnit.test('template wrapper element inherits maxHeight and minHeight styles from parent when popup dimensions are auto (T1259619)', function(assert) {
1077+
const popup = $('#popup').dxPopup({
1078+
visible: true,
1079+
height: 'auto',
1080+
width: 'auto',
1081+
showTitle: false,
1082+
contentTemplate() {
1083+
return $('<div>')
1084+
.addClass('templateWrapper')
1085+
.text('testContent');
1086+
}
1087+
}).dxPopup('instance');
1088+
1089+
const $templateWrapper = popup.$content().find('.templateWrapper');
1090+
const maxHeight = $templateWrapper.css('maxHeight');
1091+
const minHeight = $templateWrapper.css('minHeight');
1092+
1093+
assert.strictEqual(maxHeight, 'none', 'maxHeight is inherited correctly');
1094+
assert.strictEqual(minHeight, '0px', 'minHeight is inherited correctly');
1095+
});
10761096

10771097
QUnit.test('popup height should support TreeView with Search if height = auto (T724029)', function(assert) {
10781098
if(IS_OLD_SAFARI) {

0 commit comments

Comments
 (0)