Skip to content

Commit 0aab171

Browse files
Form: loadPanel indicator shouldn't be cropped in Material and Generic themes (#30984)
1 parent 2dc74c3 commit 0aab171

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

packages/devextreme/js/__internal/ui/form/form.load_panel.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import LoadIndicator, { AnimationType } from '@ts/ui/load_indicator';
88
import type { LoadPanelProperties } from '@ts/ui/load_panel';
99
import type LoadPanel from '@ts/ui/load_panel';
1010

11-
const FORM_LOAD_INDICATOR_SIZE = 120;
11+
export const FORM_LOAD_INDICATOR_SIZE = 120;
1212

1313
interface FormLoadPanelDependencies {
1414
$container: dxElementWrapper;
@@ -63,6 +63,10 @@ export class FormLoadPanel {
6363
.appendTo(this._dependencies.$container);
6464

6565
this._loadPanel = this._dependencies.onLoadPanelCreate($loadPanel, {
66+
width: FORM_LOAD_INDICATOR_SIZE,
67+
height: FORM_LOAD_INDICATOR_SIZE,
68+
maxHeight: undefined,
69+
maxWidth: undefined,
6670
position: {
6771
of: this._dependencies.$container.get(0),
6872
},

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

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ import {
4343
FORM_LOAD_PANEL_WRAPPER_CLASS
4444
} from '__internal/ui/form/constants';
4545

46+
import { FORM_LOAD_INDICATOR_SIZE } from '__internal/ui/form/form.load_panel';
47+
4648
import {
4749
GET_LABEL_WIDTH_BY_TEXT_CLASS,
4850
FIELD_ITEM_OPTIONAL_MARK_CLASS,
@@ -5349,16 +5351,27 @@ QUnit.module('LoadIndicator', () => {
53495351
const $loadPanel = form.$element().find(`.${FORM_LOAD_PANEL_CLASS}`);
53505352
const loadPanelInstance = $loadPanel.data('dxLoadPanel');
53515353

5352-
assert.strictEqual(loadPanelInstance.option('visible'), true, 'LoadPanel is visible');
5353-
assert.strictEqual(loadPanelInstance.option('showIndicator'), true, 'LoadPanel shows indicator');
5354-
assert.strictEqual(loadPanelInstance.option('showPane'), false, 'LoadPanel does not show pane');
5355-
assert.strictEqual(loadPanelInstance.option('shading'), false, 'LoadPanel does not show shading');
5356-
assert.strictEqual(loadPanelInstance.option('hideOnOutsideClick'), false, 'LoadPanel does not hide on outside click');
5357-
assert.strictEqual(loadPanelInstance.option('hideOnParentScroll'), false, 'LoadPanel does not hide on parent scroll');
5358-
assert.strictEqual(loadPanelInstance.option('deferRendering'), false, 'LoadPanel does not defer rendering');
5359-
assert.strictEqual(loadPanelInstance.option('disabled'), false, 'LoadPanel is not disabled');
5360-
assert.strictEqual(loadPanelInstance.option('message'), '', 'LoadPanel has empty message');
5361-
assert.strictEqual(loadPanelInstance.option('wrapperAttr.class'), FORM_LOAD_PANEL_WRAPPER_CLASS, 'LoadPanel has correct wrapper class');
5354+
5355+
const expectedOptions = {
5356+
visible: true,
5357+
showIndicator: true,
5358+
showPane: false,
5359+
shading: false,
5360+
hideOnOutsideClick: false,
5361+
hideOnParentScroll: false,
5362+
deferRendering: false,
5363+
disabled: false,
5364+
message: '',
5365+
'wrapperAttr.class': FORM_LOAD_PANEL_WRAPPER_CLASS,
5366+
width: FORM_LOAD_INDICATOR_SIZE,
5367+
height: FORM_LOAD_INDICATOR_SIZE,
5368+
maxWidth: undefined,
5369+
maxHeight: undefined
5370+
};
5371+
5372+
Object.entries(expectedOptions).forEach(([optionName, value]) => {
5373+
assert.strictEqual(loadPanelInstance.option(optionName), value, `${optionName} option has correct default value`);
5374+
});
53625375
});
53635376

53645377
QUnit.test('LoadPanel has correct positioning relative to form', function(assert) {
@@ -5448,9 +5461,12 @@ QUnit.module('LoadIndicator', () => {
54485461
assert.strictEqual(form.option('disabled'), true, 'Form is disabled during operation');
54495462

54505463
clock.tick(150);
5464+
54515465
assert.strictEqual(form.$element().find(`.${FORM_LOAD_PANEL_CLASS}`).length, 1, 'LoadPanel is still present but hidden');
5466+
54525467
const $loadPanel = form.$element().find(`.${FORM_LOAD_PANEL_CLASS}`);
54535468
const loadPanelInstance = $loadPanel.data('dxLoadPanel');
5469+
54545470
assert.strictEqual(loadPanelInstance.option('visible'), false, 'LoadPanel is hidden after operation');
54555471
assert.strictEqual(form.option('disabled'), false, 'Form is enabled after operation');
54565472

0 commit comments

Comments
 (0)