Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popup: scrollbar appears when content does not overflow the height (T1253645) (#28779) #28784

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
1 change: 1 addition & 0 deletions packages/devextreme-scss/scss/widgets/base/_popup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
}

& .dx-popup-content > .dx-template-wrapper {
display: flow-root;
height: 100%;
width: 100%;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/devextreme/js/__internal/ui/popup/m_popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const POPUP_FULL_SCREEN_CLASS = 'dx-popup-fullscreen';
const POPUP_FULL_SCREEN_WIDTH_CLASS = 'dx-popup-fullscreen-width';
const POPUP_NORMAL_CLASS = 'dx-popup-normal';
const POPUP_CONTENT_CLASS = 'dx-popup-content';
const POPUP_CONTENT_SCROLLABLE_CLASS = 'dx-popup-content-scrollable';
export const POPUP_CONTENT_SCROLLABLE_CLASS = 'dx-popup-content-scrollable';

const DISABLED_STATE_CLASS = 'dx-state-disabled';
const POPUP_DRAGGABLE_CLASS = 'dx-popup-draggable';
Expand All @@ -58,7 +58,7 @@ const POPUP_BOTTOM_CLASS = 'dx-popup-bottom';

const POPUP_HAS_CLOSE_BUTTON_CLASS = 'dx-has-close-button';

const TEMPLATE_WRAPPER_CLASS = 'dx-template-wrapper';
export const TEMPLATE_WRAPPER_CLASS = 'dx-template-wrapper';

const POPUP_CONTENT_FLEX_HEIGHT_CLASS = 'dx-popup-flex-height';
const POPUP_CONTENT_INHERIT_HEIGHT_CLASS = 'dx-popup-inherit-height';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ import themes from 'ui/themes';
import executeAsyncMock from '../../helpers/executeAsyncMock.js';
import visibilityChangeUtils from 'common/core/events/visibility_change';
import domAdapter from '__internal/core/m_dom_adapter';
import {
TEMPLATE_WRAPPER_CLASS,
POPUP_CONTENT_SCROLLABLE_CLASS,
} from '__internal/ui/popup/m_popup';

import 'generic_light.css!';
import 'ui/popup';
Expand All @@ -37,7 +41,6 @@ const IS_IOS_DEVICE = devices.real().platform === 'ios';
const IS_OLD_SAFARI = IS_SAFARI && compareVersions(browser.version, [11]) < 0;
const PREVENT_SAFARI_SCROLLING_CLASS = 'dx-prevent-safari-scrolling';

const POPUP_CONTENT_SCROLLABLE_CLASS = 'dx-popup-content-scrollable';
const TOOLBAR_LABEL_CLASS = 'dx-toolbar-label';

themes.setDefaultTimeout(0);
Expand Down Expand Up @@ -694,7 +697,7 @@ QUnit.module('dimensions', {
'title': {
render: function(args) {
const $element = $('<span>')
.addClass('dx-template-wrapper')
.addClass(TEMPLATE_WRAPPER_CLASS)
.text('text');

return $element.get(0);
Expand Down Expand Up @@ -1094,6 +1097,25 @@ QUnit.module('options changed callbacks', {
assert.strictEqual(minHeight, '0px', 'minHeight is inherited correctly');
});

QUnit.test('Template wrapper element uses "display: flow-root" to prevent the appearance of scrollbar (T1253645)', function(assert) {
const popup = $('#popup').dxPopup({
visible: true,
width: 300,
height: 300,
showTitle: false,
contentTemplate() {
return $('<div>')
.addClass(TEMPLATE_WRAPPER_CLASS)
.append('<p>test content</p>');
}
}).dxPopup('instance');

const $templateWrapper = popup.$content().find(`.${TEMPLATE_WRAPPER_CLASS}`);
const overflow = $templateWrapper.css('display');

assert.strictEqual(overflow, 'flow-root', 'overflow property is set to hidden');
});

QUnit.test('popup height should support TreeView with Search if height = auto (T724029)', function(assert) {
if(IS_OLD_SAFARI) {
assert.expect(0);
Expand Down
Loading