-
Notifications
You must be signed in to change notification settings - Fork 664
Scheduler: add new scroll api method #32190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 26_1
Are you sure you want to change the base?
Conversation
7b8e737 to
67cd482
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds a new API method overload to the Scheduler component's scrollTo method, allowing users to specify scroll alignment ('start' or 'center') when scrolling to a specific date.
Changes:
- Adds new
scrollTomethod signature that accepts an options object withgroup,allDay, andalignproperties - Implements alignment logic in the workspace scroll calculations (defaults to 'center' for backward compatibility)
- Adds comprehensive Jest tests for the workspace-level scrollTo functionality
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/devextreme/ts/dx.all.d.ts | Adds new scrollTo method overload with options object parameter for dx.all bundle |
| packages/devextreme/js/ui/scheduler.d.ts | Adds new scrollTo method overload with JSDoc annotations and references new SchedulerScrollToAlign enum |
| packages/devextreme/js/__internal/scheduler/workspaces/m_work_space.ts | Implements align parameter in workspace scrollTo method to calculate scroll offsets based on alignment |
| packages/devextreme/js/__internal/scheduler/m_scheduler.ts | Adds type guard to distinguish between positional and options-object parameters, forwards align to workspace |
| packages/devextreme/js/__internal/scheduler/tests/workspace.base.test.ts | Adds comprehensive tests for workspace scrollTo with different alignment options |
packages/devextreme/js/__internal/scheduler/__tests__/workspace.base.test.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
| await waitAsync(0); | ||
|
|
||
| assert.equal(errors.log.callCount, 0, 'warning has been called once'); | ||
| assert.equal(errors.log.callCount, 1, 'deprecation warning has been called once'); |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing QUnit tests have been updated to expect deprecation warnings for the old API, but there are no new tests in this file that verify the new options-based API works correctly with the align parameter. Consider adding tests that call scrollTo(date, { align: 'start' }) and scrollTo(date, { align: 'center', group: ..., allDay: ... }) to verify the new API functionality.
| return Boolean(options) && typeof options === 'object' | ||
| && ('align' in options || 'allDay' in options || 'group' in options); |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type guard logic will incorrectly identify group values objects as the new options object if they happen to have an 'allDay' or 'group' property. Since group values can be arbitrary objects (e.g., { ownerId: 2 }), the type guard should only check for the presence of the 'align' property to definitively identify the new API usage. Update the condition to: return Boolean(options) && typeof options === 'object' && 'align' in options;
| return Boolean(options) && typeof options === 'object' | |
| && ('align' in options || 'allDay' in options || 'group' in options); | |
| return Boolean(options) && typeof options === 'object' && 'align' in options; |
No description provided.