Skip to content

Commit 6b503c9

Browse files
committed
test: fix tests
1 parent 6c373fd commit 6b503c9

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

packages/devextreme/js/__internal/scheduler/appointment_popup/appointment_popup.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ describe('Appointment Popup Form', () => {
463463

464464
POM.popup.getBackButton().click();
465465

466-
expect(POM.popup.component.option('height')).toBeUndefined();
466+
expect(POM.popup.component.option('height')).toBe('auto');
467467
expect(mainGroup.hasClass(CLASSES.mainGroupHidden)).toBe(false);
468468
expect(recurrenceGroup.hasClass(CLASSES.recurrenceGroupHidden)).toBe(true);
469469
});

packages/devextreme/js/__internal/scheduler/appointment_popup/m_form.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ export class AppointmentForm {
142142

143143
private _$recurrenceGroup?: dxElementWrapper;
144144

145-
private _initialPopupHeight?: string | number;
146-
147145
get dxForm(): dxForm {
148146
return this._dxForm as dxForm;
149147
}
@@ -205,7 +203,6 @@ export class AppointmentForm {
205203

206204
create(popup: any): void {
207205
this._popup = popup;
208-
this._initialPopupHeight = this.dxPopup.option('height') as string | number;
209206

210207
const mainGroup = this.createMainFormGroup();
211208

@@ -808,8 +805,12 @@ export class AppointmentForm {
808805
}
809806

810807
showRecurrenceGroup(): void {
811-
const overlayHeight = this.dxPopup.$overlayContent().get(0).clientHeight;
812-
this.dxPopup.option('height', overlayHeight);
808+
const currentHeight = this.dxPopup.option('height') as string | number | undefined;
809+
810+
if (currentHeight === 'auto' || currentHeight === undefined) {
811+
const overlayHeight = this.dxPopup.$overlayContent().get(0).clientHeight;
812+
this.dxPopup.option('height', overlayHeight);
813+
}
813814

814815
this._$mainGroup?.addClass(CLASSES.mainHidden);
815816
this._$recurrenceGroup?.removeClass(CLASSES.recurrenceHidden);
@@ -826,7 +827,13 @@ export class AppointmentForm {
826827
}
827828

828829
showMainGroup(saveRecurrenceValue = true): void {
829-
this.dxPopup.option('height', this._initialPopupHeight);
830+
const currentHeight = this.dxPopup.option('height') as string | number | undefined;
831+
const editingConfig = this.scheduler.getEditingConfig();
832+
const configuredHeight = editingConfig?.popup?.height ?? 'auto';
833+
834+
if (typeof currentHeight === 'number') {
835+
this.dxPopup.option('height', configuredHeight);
836+
}
830837

831838
this._$mainGroup?.removeClass(CLASSES.mainHidden);
832839
this._$recurrenceGroup?.addClass(CLASSES.recurrenceHidden);

0 commit comments

Comments
 (0)