Skip to content

Commit

Permalink
Scheduler - Fix - It throw exception while opening appointment popup …
Browse files Browse the repository at this point in the history
…form with deferredRendering = false (T1069753) (#21192)
  • Loading branch information
AntonSermyazhko authored Feb 24, 2022
1 parent 53c8682 commit b2aa10f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 7 deletions.
18 changes: 12 additions & 6 deletions js/ui/scheduler/appointmentPopup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ export class AppointmentPopup {
}

triggerResize() {
this.popup && triggerResizeEvent(this.popup.$element());
if(this.popup) {
triggerResizeEvent(this.popup.$element());
}
}

_getMaxWidth(isRecurrence) {
Expand All @@ -254,11 +256,15 @@ export class AppointmentPopup {
}

changeSize(isRecurrence) {
const fullScreen = this._isPopupFullScreenNeeded();
this.popup.option({
fullScreen,
maxWidth: fullScreen ? '100%' : this._getMaxWidth(isRecurrence),
});
if(this.popup) {
const fullScreen = this._isPopupFullScreenNeeded();
this.popup.option({
fullScreen,
maxWidth: fullScreen
? '100%'
: this._getMaxWidth(isRecurrence),
});
}
}

updatePopupFullScreenMode() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Scheduler from '../../../model/scheduler';
import createWidget from '../../../helpers/createWidget';
import url from '../../../helpers/getPageUrl';

fixture`Timeline Appointments`
fixture`Appointment Form`
.page(url(__dirname, '../../container.html'));

const showAppointmentPopup = ClientFunction(() => {
Expand All @@ -28,3 +28,35 @@ test('Invoke showAppointmentPopup method shouldn\'t raise error if value of curr
currentDate: new Date(2021, 2, 25).toISOString(),
height: 600,
}, true));

test('Show appointment popup if deffereRendering is false (T1069753)', async (t) => {
const scheduler = new Scheduler('#container');
const appointment = scheduler.getAppointmentByIndex(0);

await t
.doubleClick(appointment.element)
.expect(scheduler.appointmentPopup.isVisible)
.ok();
}).before(async () => {
await ClientFunction(() => {
(window as any).DevExpress.ui.dxPopup.defaultOptions({
options: {
deferRendering: false,
},
});
})();

await createWidget('dxScheduler', {
dataSource: [{
text: 'Test',
startDate: new Date(2021, 2, 29, 10),
endDate: new Date(2021, 2, 29, 11),
}],
views: ['day'],
currentView: 'day',
currentDate: new Date(2021, 2, 29),
startDayHour: 9,
endDayHour: 12,
width: 400,
}, true);
});

0 comments on commit b2aa10f

Please sign in to comment.