Skip to content

Commit 62affe9

Browse files
authored
Scheduler: Fix appointment rendering when virtual scrolling is enabled (T1263428) (#28611)
Co-authored-by: Alyar <>
1 parent 6857043 commit 62affe9

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

e2e/testcafe-devextreme/tests/scheduler/virtualScrolling/appointments.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Scheduler from 'devextreme-testcafe-models/scheduler';
2+
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
23
import { getStyleAttribute, setStyleAttribute } from '../../../helpers/domUtils';
34
import { createWidget } from '../../../helpers/createWidget';
45
import url from '../../../helpers/getPageUrl';
@@ -39,3 +40,48 @@ test.skip('Appointment should not repaint after scrolling if present on viewport
3940
}],
4041
});
4142
});
43+
44+
test('The appointment should render correctly when scrolling vertically (T1263428)', async (t) => {
45+
const scheduler = new Scheduler('#container');
46+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
47+
48+
await scrollTo(new Date('2024-11-12T09:00:00+0100'));
49+
50+
await takeScreenshot('T1263428-virtual-scrolling-render-appointment.png', scheduler.element);
51+
52+
await t
53+
.expect(compareResults.isValid())
54+
.ok(compareResults.errorMessages());
55+
}).before(async () => {
56+
await createWidget('dxScheduler', {
57+
height: 500,
58+
width: 900,
59+
timeZone: 'Europe/Vienna',
60+
dateSerializationFormat: 'yyyy-MM-ddTHH:mm:ssxx',
61+
currentDate: new Date(2024, 10, 11, 20, 54, 23, 361),
62+
cellDuration: 20,
63+
firstDayOfWeek: 1,
64+
startDayHour: 12.0,
65+
endDayHour: 18.0,
66+
allDayPanelMode: 'hidden',
67+
scrolling: {
68+
mode: 'virtual',
69+
},
70+
crossScrollingEnabled: true,
71+
currentView: 'week',
72+
textExpr: 'Subject',
73+
startDateExpr: 'StartDate',
74+
endDateExpr: 'EndDate',
75+
views: [{
76+
type: 'week',
77+
groupByDate: true,
78+
startDayHour: 6.0,
79+
endDayHour: 22.0,
80+
}],
81+
dataSource: [{
82+
Subject: 'Website Re-Design Plan',
83+
StartDate: new Date('2024-11-11T12:10:00+0100'),
84+
EndDate: new Date('2024-11-12T21:00:00+0100'),
85+
}],
86+
});
87+
});
19 KB
Loading

packages/devextreme/js/__internal/scheduler/appointments/rendering_strategies/m_strategy_vertical.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ class VerticalRenderingStrategy extends BaseAppointmentsStrategy {
207207
vMax,
208208
vMin,
209209
} = appointmentSettings;
210-
211-
const maxHeight = this.isVirtualScrolling ? vMax : vMax - vMin;
210+
const { bottomVirtualRowHeight = 0 } = this.viewDataProvider.getViewOptions();
211+
const maxHeight = this.isVirtualScrolling ? vMax + bottomVirtualRowHeight : vMax - vMin;
212212

213213
const hasTailPart = this.options.endViewDate > appointmentSettings.info.appointment.endDate;
214214
let left = Math.round(appointmentSettings.left + offset);

0 commit comments

Comments
 (0)