Scheduler - A11y - Don't hide tooltip on item delete#33352
Scheduler - A11y - Don't hide tooltip on item delete#33352Tucchhaa merged 10 commits intoDevExpress:26_1from
Conversation
| assert.equal(scheduler.tooltip.getDateText(), 'February 9 11:00 AM - 12:00 PM', 'dates and time were displayed correctly'); | ||
| }); | ||
|
|
||
| test('Click on tooltip-remove button should call scheduler.deleteAppointment and hide tooltip', async function(assert) { |
There was a problem hiding this comment.
Removed this test, because there is a new jest test covering this case
| assert.notOk(scheduler.tooltip.isVisible(), 'tooltip was hidden'); | ||
| }); | ||
|
|
||
| test('Click on tooltip-remove button should call scheduler.updateAppointment and hide tooltip, if recurrenceRuleExpr and recurrenceExceptionExpr is set', async function(assert) { |
There was a problem hiding this comment.
Removed this test, because there is a new jest test covering this case
There was a problem hiding this comment.
Pull request overview
This PR updates Scheduler appointment tooltip behavior (including compact/collector tooltips) so that deleting an item does not automatically hide the tooltip, improving keyboard/a11y workflows and reducing disruptive UI changes.
Changes:
- Stop hiding the tooltip on delete actions (mouse and keyboard) and update tooltip contents in-place when collector items change.
- Extend the appointment view-model diffing to support an “update items” operation (vs remove+add) to avoid unnecessary re-renders.
- Update unit/integration/e2e tests and mocks to reflect the new tooltip lifecycle and rendering behavior.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.appointmentTooltip.tests.js | Updates integration expectations: collector tooltip stays visible until last item removed; tooltip updates after dataSource changes. |
| packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/integration.adaptivity.tests.js | Adjusts mobile tooltip test to expect tooltip to remain visible after delete. |
| packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/desktopTooltip.tests.js | Updates desktop tooltip tests for new List options and new API name (isShownForTarget). |
| packages/devextreme/testing/tests/DevExpress.ui.widgets.scheduler/common.methods.tests.js | Updates scheduler method tests to use isShownForTarget. |
| packages/devextreme/js/__internal/scheduler/tooltip_strategies/m_tooltip_strategy_base.ts | Adds tooltip target/list update helpers; removes hide-on-delete; adds repaintChangesOnly; renames isAlreadyShown → isShownForTarget. |
| packages/devextreme/js/__internal/scheduler/m_scheduler.ts | Wires tooltip strategy earlier and injects appointmentTooltip into appointments options; uses isShownForTarget. |
| packages/devextreme/js/__internal/scheduler/appointments/utils/get_view_model_diff.ts | Refactors diffing to support a dedicated “update items” change type. |
| packages/devextreme/js/__internal/scheduler/appointments/utils/get_arrays_diff.ts | Adds needToUpdateItems diff operation and expands diff API (match/equal/itemsLengthEqual). |
| packages/devextreme/js/__internal/scheduler/appointments/utils/get_arrays_diff.test.ts | Updates and expands Jest coverage for the new diff behavior and flags. |
| packages/devextreme/js/__internal/scheduler/appointments/m_appointment_collection.ts | Implements tooltip-aware remove/update flows and reuses compact-appointment item mapping. |
| packages/devextreme/js/__internal/scheduler/tests/appointment_tooltip.test.ts | Expands Jest tests for delete behavior, collector tooltip persistence, and tooltip target stability. |
| packages/devextreme/js/__internal/scheduler/tests/mock/model/tooltip.ts | Adds accessors for tooltip instance/target and improves delete button querying. |
| packages/devextreme/js/__internal/scheduler/tests/mock/m_mock_scheduler.ts | Adds getClientRects mocking to support tooltip list navigation sizing. |
| e2e/testcafe-devextreme/tests/scheduler/common/recurrences/etalons/recurrence-delete-dialog-screenshot (fluent.blue.light).png | Updates screenshot baseline for recurrence delete dialog. |
| } | ||
|
|
||
| if (item.needToRemove) { | ||
| item.element?.detach(); |
There was a problem hiding this comment.
no need for calling detach, can just remove element directly
| a: AppointmentViewModelPlain, | ||
| b: AppointmentViewModelPlain, | ||
| ): boolean => { | ||
| if ('items' in a && 'items' in b) { |
There was a problem hiding this comment.
Found an edge case when the tooltip hides despite collector having appointments.
Paste this code and try to delete appointment "B"
$("#scheduler").dxScheduler({
dataSource: [
{
id: 1,
text: "A",
startDate: new Date(2025, 0, 8),
endDate: new Date(2025, 0, 11),
},
{
id: 2,
text: "B",
startDate: new Date(2025, 0, 8),
endDate: new Date(2025, 0, 11),
},
{
id: 3,
text: "C",
startDate: new Date(2025, 0, 8),
endDate: new Date(2025, 0, 10),
},
{
id: 4,
text: "D",
startDate: new Date(2025, 0, 8),
endDate: new Date(2025, 0, 9),
},
],
views: [{ type: "month", maxAppointmentsPerCell: 1 }],
currentView: "month",
currentDate: new Date(2025, 0, 8),
});
I think the reason for this bug is the line here. We could make the equal function more strict
There was a problem hiding this comment.
Thanks, I have fixed this case
No description provided.