Skip to content

Commit 793cf7e

Browse files
Scheduler - Close Repeat SelectBox popup when navigating to recurrence group
1 parent 90c263f commit 793cf7e

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,28 @@ describe('Appointment Form', () => {
13231323
expect(POM.popup.isRecurrenceGroupVisible()).toBe(true);
13241324
});
13251325

1326+
it('should close repeat selectbox popup when navigating to recurrence group via settings button', async () => {
1327+
const { POM, scheduler } = await createScheduler({
1328+
...getDefaultConfig(),
1329+
dataSource: [{ ...recurringAppointment }],
1330+
});
1331+
1332+
const dataSource = (scheduler as any).getDataSource();
1333+
const appointment = dataSource.items()[0];
1334+
1335+
scheduler.showAppointmentPopup(appointment);
1336+
POM.popup.editSeriesButton.click();
1337+
1338+
const repeatEditor = POM.popup.dxForm.getEditor('repeatEditor');
1339+
POM.popup.getInput('repeatEditor').click();
1340+
1341+
expect(repeatEditor?.option('opened')).toBe(true);
1342+
1343+
POM.popup.recurrenceSettingsButton.click();
1344+
1345+
expect(repeatEditor?.option('opened')).toBe(false);
1346+
});
1347+
13261348
it('should have disabled week day buttons when allowUpdating is false', async () => {
13271349
const { POM, scheduler } = await createScheduler({
13281350
...getDefaultConfig(),

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import type { Properties as SwitchProperties } from '@js/ui/switch';
1717
import type { Properties as TextAreaProperties } from '@js/ui/text_area';
1818
import { current, isFluent } from '@js/ui/themes';
1919
import { dateSerialization } from '@ts/core/utils/m_date_serialization';
20+
import DropDownEditor from '@ts/ui/drop_down_editor/m_drop_down_editor';
2021
import type Popup from '@ts/ui/popup/m_popup';
2122

2223
import timeZoneUtils from '../m_utils_time_zone';
@@ -917,6 +918,11 @@ export class AppointmentForm {
917918
}
918919

919920
showRecurrenceGroup(): void {
921+
const repeatEditor = this.dxForm.getEditor(REPEAT_EDITOR_NAME);
922+
if (repeatEditor instanceof DropDownEditor) {
923+
repeatEditor.close();
924+
}
925+
920926
this._popup.updateToolbarForRecurrenceGroup();
921927

922928
const currentHeight = this.dxPopup.option('height') as string | number | undefined;

0 commit comments

Comments
 (0)