diff --git a/docs/guides/recurring-events.md b/docs/guides/recurring-events.md index f449bf4..0d794d1 100644 --- a/docs/guides/recurring-events.md +++ b/docs/guides/recurring-events.md @@ -471,6 +471,48 @@ For example: addEventListener(node, "click", function(){...}) ~~~ +## Custom confirmation modal {#customconfirmationmodal} + +When a user edits or drags a recurring event, the scheduler displays a built-in modal that asks whether to modify just this occurrence, this and following events, or the entire series. You can replace it with your own UI by overriding `scheduler.ext.recurring.confirm`. + +~~~js +scheduler.ext.recurring.confirm = function(context) { + // context contains: + // - origin: "lightbox" | "dnd" + // - occurrence: the occurrence event object + // - series: the parent series event object + // - labels: { title, ok, cancel, occurrence, following, series } + // - options: ["occurrence", "following", "series"] + // + // Return one of: "occurrence", "following", "series", or null to cancel. + // Can return a Promise for async UI. + + return new Promise(function(resolve) { + myCustomDialog.show({ + title: context.labels.title, + options: context.options, + onSelect: function(choice) { resolve(choice); }, + onCancel: function() { resolve(null); } + }); + }); +}; +~~~ + +The context object has the following properties: + +| Property | Type | Description | +|---|---|---| +| `origin` | `"lightbox" \| "dnd"` | Whether the action was triggered from the lightbox or drag-and-drop | +| `occurrence` | `object` | The specific occurrence being edited | +| `series` | `object` | The parent recurring event | +| `labels` | `object` | Localized strings: `title`, `ok`, `cancel`, `occurrence`, `following`, `series` | +| `options` | `string[]` | Available choices, e.g. `["occurrence", "following", "series"]` | + +The function must return `"occurrence"`, `"following"`, `"series"`, or `null` to cancel. It can return the value directly or as a Promise. + +For a React implementation, see the [React Scheduler documentation](integrations/react/overview.md#customizing-the-recurrence-confirmation-modal). + + ## Legacy format of recurring events Until v7.1 Scheduler used a custom format for recurring events, you can find the format details [here](guides/recurring-events-legacy.md). diff --git a/docs/integrations/react/overview.md b/docs/integrations/react/overview.md index 87c22ee..585cf6c 100644 --- a/docs/integrations/react/overview.md +++ b/docs/integrations/react/overview.md @@ -351,6 +351,60 @@ The delete confirmation dialog can be overridden via `modals`. /> ``` +### Customizing the Recurrence Confirmation Modal {#customizingtherecurrenceconfirmationmodal} + +When a user edits or drags a recurring event, a confirmation modal asks whether to modify just this occurrence, this and following events, or the entire series. You can replace this built-in dialog with your own using `modals.onRecurrenceConfirm`. + +The callback receives a context object and must return a decision (or a Promise that resolves to one): + +| Field | Type | Description | +|---|---|---| +| `origin` | `"lightbox" \| "dnd"` | Whether the action was triggered from the lightbox or drag-and-drop | +| `occurrence` | `any` | The specific occurrence being edited | +| `series` | `any` | The parent recurring event | +| `labels` | `object` | Localized labels: `title`, `ok`, `cancel`, `occurrence`, `following`, `series` | +| `options` | `string[]` | Available choices, e.g. `["occurrence", "following", "series"]` | + +Return value (`RecurrenceDecision`): `"occurrence"`, `"following"`, `"series"`, or `null` to cancel. + +Example: + +```tsx +import { useState, useCallback } from "react"; + +function App() { + const [recurrencePrompt, setRecurrencePrompt] = useState(null); + + const onRecurrenceConfirm = useCallback((context) => { + return new Promise((resolve) => { + setRecurrencePrompt({ context, resolve }); + }); + }, []); + + return ( + <> + + {recurrencePrompt && ( + { + recurrencePrompt.resolve(choice); + setRecurrencePrompt(null); + }} + onCancel={() => { + recurrencePrompt.resolve(null); + setRecurrencePrompt(null); + }} + /> + )} + + ); +} +``` + ## Filtering Use the `filter` prop to control which events are displayed: diff --git a/docs/whats-new.md b/docs/whats-new.md index 7e452f3..061642d 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -7,6 +7,25 @@ sidebar_label: "What's New" If you are updating Scheduler from an older version, check [Migration From Older Versions](migration.md) for details. +7.2.12 +------------- +March 23, 2026. Bugfix release + +### Fixes + +- Fix the crash on page reload in [React Scheduler](integrations/react/overview.md) when using non-default themes with the [cookie](guides/extensions-list.md#cookie) plugin enabled +- Fix the regression where the `save` URL in the `data` prop was not applied correctly in [React Scheduler](integrations/react/overview.md) +- Fix the issue where editing a non-first occurrence of a [recurring event](guides/recurring-events.md) in "This and following events" mode did not apply all [lightbox](guides/configuring-the-lightbox.md) field changes +- Fix the issue where dynamically changing [Quick Info](guides/quick-info.md) buttons based on event conditions did not update the popup correctly +- Fix the issue where modifying the text of a single [recurring event](guides/recurring-events.md) occurrence was overwritten after editing a subsequent occurrence in "This and following events" mode +- Fix the overflow styles of the [Quick Info](guides/quick-info.md) popup to properly handle long event descriptions +- Fix the script error in [React Scheduler](integrations/react/overview.md) that occurred when adding events to an existing dataset via the `useState` function + +### Updates + +- Add the ability to replace the [recurring event confirmation modal](guides/recurring-events.md#customconfirmationmodal) with a custom dialog. +- Add the ability to replace the [recurring event confirmation modal](integrations/react/overview.md#customizingtherecurrenceconfirmationmodal) in [React Scheduler](integrations/react/overview.md) via the modals.onRecurrenceConfirm prop + 7.2.11 ------------- January 12, 2026. Bugfix release