From 7875dd4968d6377cbbb69fd2a1e2853c854768f9 Mon Sep 17 00:00:00 2001 From: EugeniyKiyashko Date: Wed, 15 Jan 2025 18:37:36 +0400 Subject: [PATCH] Popup: template wrapper element inherits maxHeight and minHeight styles from parent when popup dimensions are auto (T1259619) --- .../scss/widgets/base/_popup.scss | 2 +- .../DevExpress.ui.widgets/popup.tests.js | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/devextreme-scss/scss/widgets/base/_popup.scss b/packages/devextreme-scss/scss/widgets/base/_popup.scss index df37ebd39046..19931714fe72 100644 --- a/packages/devextreme-scss/scss/widgets/base/_popup.scss +++ b/packages/devextreme-scss/scss/widgets/base/_popup.scss @@ -82,7 +82,7 @@ .dx-popup-inherit-height & { @include dx-popup-content-auto-resizing(); - > .dx-template-wrapper { + > div { max-height: inherit; min-height: inherit; diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets/popup.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets/popup.tests.js index 79c984441973..44acf93f9317 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets/popup.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets/popup.tests.js @@ -1073,6 +1073,26 @@ QUnit.module('options changed callbacks', { assert.ok($popup.hasClass(POPUP_CONTENT_INHERIT_HEIGHT_CLASS), 'has POPUP_CONTENT_INHERIT_HEIGHT_CLASS with auto width'); }); + QUnit.test('template wrapper element inherits maxHeight and minHeight styles from parent when popup dimensions are auto (T1259619)', function(assert) { + const popup = $('#popup').dxPopup({ + visible: true, + height: 'auto', + width: 'auto', + showTitle: false, + contentTemplate() { + return $('
') + .addClass('templateWrapper') + .text('testContent'); + } + }).dxPopup('instance'); + + const $templateWrapper = popup.$content().find('.templateWrapper'); + const maxHeight = $templateWrapper.css('maxHeight'); + const minHeight = $templateWrapper.css('minHeight'); + + assert.strictEqual(maxHeight, 'none', 'maxHeight is inherited correctly'); + assert.strictEqual(minHeight, '0px', 'minHeight is inherited correctly'); + }); QUnit.test('popup height should support TreeView with Search if height = auto (T724029)', function(assert) { if(IS_OLD_SAFARI) {